Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django celery random raise SystemExit

I have a celery task that handles copying large files (30 GB). The function looks like this:

def copy(self, src, dest):
        self.execute('cp %s %s &' % (src, dest))
        while self.get_file_size(src) != self.get_file_size(dest):
            time.sleep(3)

Now it seems that celery randomly (sometime it happens after 1 min sometime 15 min) raise a SystemExit execption with the following traceback:

Traceback (most recent call last):
 File "/some/path/tasks.py", line 51, in create_vm
   vm.create()
 File "/some/path/models.py", line 115, in create
   self.server.copy(self.template_path, self.vdi_path)
 File "/some/path/models.py", line 451, in copy
   time.sleep(3)
 File "/usr/local/lib/python2.7/dist-packages/billiard/common.py", line 95, in _shutdown_cleanup
   sys.exit(-(256 - signum))
 File "/usr/local/lib/python2.7/dist-packages/billiard/pool.py", line 279, in exit
   return _exit()
SystemExit

What can cause celery to raise such an exception?

like image 884
user2302807 Avatar asked Aug 04 '26 10:08

user2302807


1 Answers

The reason why celery raised a SystemExit exception is because celery restarted.

From the log:

Restarting celery worker (./manage.py celeryd)

And the reason why celery restarted is because it was initially started over ssh, and it got killed when ssh user disconnected.

like image 173
user2302807 Avatar answered Aug 07 '26 01:08

user2302807



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!