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

Handling exceptions in Worker plugins #4297

Closed
pentschev opened this issue Dec 2, 2020 · 1 comment · Fixed by #4298
Closed

Handling exceptions in Worker plugins #4297

pentschev opened this issue Dec 2, 2020 · 1 comment · Fixed by #4298

Comments

@pentschev
Copy link
Member

I have noticed that Worker plugins exceptions are currently not handled, but they are checked and returned as a message to the caller in

try:
result = plugin.setup(worker=self)
if isawaitable(result):
result = await result
except Exception as e:
msg = error_message(e)
return msg

Specifically, plugins are awaited in Worker.start():

await asyncio.gather(
*[self.plugin_add(plugin=plugin) for plugin in self._pending_plugins]
)

I'm not sure what is supposed to happen with the error message, is it supposed to be passed to the scheduler somehow? Currently it seems to me that these message are silently ignored and not logged at all, but I am still not sure what is the expected way to handle this. For me, it looks as if we should check the status of message of each plugin, and if it raised an exception we should re-raise them within Worker.start() itself. Is that the right solution or is there something else we should do here? I'm happy to work on a fix either way, but I wanted to check what's the right way to fix it before spending the time on a potentially flawed fix.

@mrocklin
Copy link
Member

mrocklin commented Dec 2, 2020 via email

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

Successfully merging a pull request may close this issue.

2 participants