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

Jobs still run after context is done #10

Closed
BredSt opened this issue Oct 20, 2020 · 6 comments
Closed

Jobs still run after context is done #10

BredSt opened this issue Oct 20, 2020 · 6 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@BredSt
Copy link

BredSt commented Oct 20, 2020

HI,

I've some time to run some extended test (on the master branch code ) and I found one issue.:)

in case you provide a timeout and retry to specific task you are getting the error that the time passed which is ok. However, the task is proceed and continue to run which is problematic as the timeout should win.
User should define a timeout as limit to the task and after the job exceed the timeout it should be killed to free resources as if it pass the results after the timeout the results is not valid anymore...
as the jobResults := wp.StopWaitXT() should handle it.
WDYT?

@oze4
Copy link
Owner

oze4 commented Oct 20, 2020

Do you have some code I can test with?

Let's say you have a job that sleeps for 1 hour but your timeout is 1 second. How would you go about cancelling a job that is just sleeping (or in flight)?

@oze4 oze4 added bug Something isn't working help wanted Extra attention is needed labels Oct 20, 2020
@oze4 oze4 changed the title Timeout with retry Jobs still run after context is done Oct 20, 2020
@oze4
Copy link
Owner

oze4 commented Oct 20, 2020

This one is really stumping me.... I reached out to the author of workerpool (gammazero/workerpool#40) for help on this.. I think it is out of my understanding of Go as to why this is happening.

You can view a better POC here

Any idea how to resolve this?

@BredSt
Copy link
Author

BredSt commented Oct 21, 2020

HI,

I saw that you got a nice answer which solve the problem :-) , when to expect to new version as we want to run it on prod.

Thanks!

@oze4
Copy link
Owner

oze4 commented Oct 21, 2020

@BredSt what makes you think the problem is resovled?

@BredSt
Copy link
Author

BredSt commented Oct 22, 2020

Hi @oze4 - this replay #7 (comment), but I understand that it a bit tricky :( as the tread continue..., now I saw this gammazero/workerpool#40 (comment)
Do you think that we have a solution to this problem?

@oze4 oze4 self-assigned this Oct 25, 2020
@oze4
Copy link
Owner

oze4 commented Dec 11, 2020

Closing per

@oze4 oze4 closed this as completed Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants