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

parallel macro leaks fibers #7204

Closed
straight-shoota opened this issue Dec 19, 2018 · 2 comments
Closed

parallel macro leaks fibers #7204

straight-shoota opened this issue Dec 19, 2018 · 2 comments
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:concurrency

Comments

@straight-shoota
Copy link
Member

The parallel macro is used to run pieces of code concurrently. Ideally, it waits for all fibers to finish and returns the combined return values of all jobs.

However, when one fiber raises, the exception is raised in the enclosing context which means it will immediately resume execution. This breaks the waiting connection to the other concurrent fibers and send calls to the collector channel block indeterminately. This makes them zombie fibers.

There is no optimal strategy for all use cases, but IMO it would be a better solution to remember the exception but wait for the other fibers to complete and only raise it afterwards. This makes sure that all tasks are properly finished and only raises when execution is to continue in the parent context.

Related to #6468

@asterite
Copy link
Member

We introduced parallel just for fun, to see if we could make it work. In my opinion we should remove all these quick features (parallel, future, etc.), rethink them, then reintroduce them.

@bcardiff bcardiff added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:concurrency labels Dec 19, 2018
@Sija
Copy link
Contributor

Sija commented Apr 16, 2020

Can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:concurrency
Projects
None yet
Development

No branches or pull requests

4 participants