jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.1k stars 84 forks source link

Unhandled exception when hitting stator URL #630

Closed crookm closed 11 months ago

crookm commented 11 months ago

Hi there, I was trying to set up a small single-user super-low-cost instance of Takahe, and I noticed in the docs that there was a brief mention of being able to periodically hit an endpoint to fire off the background actions, instead of having a dedicated background worker.

When hitting that URL with a GET, I seem to be getting an unhandled internal error with the following trace logged to sentry:

ValueError: signal only works in main thread of the main interpreter
  File "django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
  File "concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "stator/views.py", line 22, in get
    runner = StatorRunner(StatorModel.subclasses, run_for=2)
  File "stator/runner.py", line 70, in __init__
    signal.signal(signal.SIGALRM, self.alarm_handler)
  File "signal.py", line 56, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))

I am using a single fresh instance of the default 0.9.0 docker image, with the default cmd line args. The web interface works perfectly, it's just this stator endpoint call that has this issue.

andrewgodwin commented 11 months ago

Ah yes, that's not actually been officially supported for a while now; it had huge issues ever finishing any work in time and it's basically deprecated. I would treat it as such for now.

crookm commented 11 months ago

I see, not a problem then. This is a very much an edge use case anyway. Thanks!