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

on_done is not called with on_start args #29

Closed
kalkschneider opened this issue Mar 4, 2020 · 3 comments · Fixed by #30
Closed

on_done is not called with on_start args #29

kalkschneider opened this issue Mar 4, 2020 · 3 comments · Fixed by #30

Comments

@kalkschneider
Copy link

Hello Cristian,

In your last release you changed the way the callback functions work. The return values of on_start are not passed to on_done as input arguments anymore. I hope you didn't do it on purpose, that makes it hard to close open connections if a worker has finished.

Your old code:

args = params.on_start(worker_info)
params.on_done(stage_status, *args)

Your new code:

f_kwargs = self.on_start(**on_start_kwargs)
on_done_kwargs = {}
done_resp = self.on_done(**on_done_kwargs)
@cgarciae
Copy link
Owner

cgarciae commented Mar 4, 2020

Hey @kalkschneider!

Let me check. 😮 I think I have tests for this.

@cgarciae
Copy link
Owner

cgarciae commented Mar 4, 2020

Fixed in version 0.2.5.

@cgarciae
Copy link
Owner

cgarciae commented Mar 4, 2020

@kalkschneider Thanks for reporting the issue!
It was a serious bug resulting from the recent refactor.

BTW: Version 0.2 brought small modifications to how these additional arguments are handled, instead of *args we are now using **kwargs which means that on_start now should return a dictionary instead of a tuple. Take a look at the new documentation for the behavior: https://cgarciae.github.io/pypeln/advanced/#resource-management

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