-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: destroy issue and use maximum workers #44
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
25cc93b
use maximum workers for isolate
Aslemammad 26f58ae
WIP: cannot reproduce the halt issue
Aslemammad c3bccaa
fix destroy issue
Aslemammad ae42cb2
trace warning
Aslemammad 0a60bdd
update
Aslemammad 34a204d
WIP:_ensureEnouhWorkersForTaskQueue
Aslemammad 2e304d0
update test
Aslemammad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@overlookmotel Do you think this solution is an optimal one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's not wrong to have workers for those that already have since we do not have info! And I think on the second condition, it creates a limit for the workers and can be helpful. I'd like to see your opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@overlookmotel Let me know if you're there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really sorry but I can't help more. As I mentioned on #42, I am very tight for time. The complexity (which we're discussing here) was exactly why I didn't feel I could make a PR myself. I find piscina's code pretty hard to disentangle.
But my guess is that your solution above is not quite right, and will create new workers when none is actually needed in some case.
My suggestion would be to look at the existing code for how it's handled when a thread is terminated due to use of an
AbortController
. That results in same situation (worker removed from pool, do we need to add a new one?) so I imagine the code for that contains a good solution.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! ok, thank you so much! I'll investigate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In AbortController the ensureMin approach is used which is not proper for our case!
I think let's stick with the
_ensureEnoughWorkersForTaskQueue
approach for now and let's see how it goes! Thanks for yout help.