Closed frol closed 6 years ago
I don't know much about the signalling system on Windows, so I don't plan supporting Windows, sorry :(
Well, if you don't mind, I will share my findings as to the running Kuyruk on Windows.
I had commented out the ALARM signal usage in the task.py:time_limit
(thus, the time limit feature is in the broken state), and also SIGHUP, SIGUSR1, and SIGUSR2 in the worker.py:Worker.run
(I am not exactly sure what it breaks, but I am sure it breaks something :)). These are all the changes I needed to make in Kuyruk to make it working on Windows!
NOTE: There is also a compatibility issue in Just a simple py-amqp
(https://github.com/celery/py-amqp/issues/135), but a simple patch, which skips setting TCP_MAXSEG
on Windows, solved the issue.amqp
upgrade (2.2.2) got everything sorted.
Given the surface of the work, I can prepare a PR to enable Windows support. Will you be so kind to review/accept it once it is ready?
Of course!
Here are my findings on the topic:
signal.alarm()
just isn't supported at all with no alternative provided)signals.alarm()
doesn't play well with threads, and the timeout value is rounded to seconds precision (e.g. timeout=0.6
=> timeout=0
)tasks.py:time_limit
implementation altogether (even for Unix!), and leave it up to kuyruk user to implement the timeout the way they like it.As to the singals handling in worker.py:Worker
:
SIGHUP
/ SIGUSR1
/ SIGUSR2
on Windows transparently.SIGUSR1
(prints traceback) and SIGUSR2
(drops a current task) are used for debug purposes, so we can just disable these features for Windows (nobody likes Windows either way :))SIGHUP
to interrupt a running task in case of lost RabbitMQ connect is quite agressive.Let's consider the solutions:
NotImplementedError
in the tasks.py:time_limit
for Windows if the seconds != 0
, thus stating clearly that it is not going to work on Windows.SIGUSR1
and SIGUSR2
handlers on Windows.SIGHUP
, but as a temporary solution, we can simply ignore the case of lost RabbitMQ connection on Windows...
Trying to start Kuyruk on Windows end up with an error due to the missing signals support on Windows:
I am going to try comment out all the signals usage, but even if that works, I believe, it will miss quite a few features... Any ideas on how to work this around for Windows?
P.S. Is Windows support something that you are interested in?