Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ValueError: signal only works in main thread" with external_program.py #3219

Open
heimalne opened this issue Jan 16, 2023 · 0 comments
Open

Comments

@heimalne
Copy link

We're running Luigi on a non-main thread and encountered another signal error problem when using ExternalProgramTask:
That task tries to register a signal handler, which crashes Luigi, because it's not on the main thread:

signal.signal(signal.SIGTERM, self.kill_job)

For workers, the following config flag for luigi.cfg was introduced as a workaround:

[worker]
no_install_shutdown_handler=True

See

luigi/luigi/worker.py

Lines 336 to 338 in 64d6b83

no_install_shutdown_handler = BoolParameter(default=False,
description='If true, the SIGUSR1 shutdown handler will'
'NOT be install on the worker')

Would a similar workaround make sense in this case as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant