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

Fix maxsize in process, task and thread #66

Merged
merged 4 commits into from
Jan 2, 2021

Conversation

charlielito
Copy link
Contributor

@charlielito charlielito commented Dec 31, 2020

This should solve this #64 and also this #55 as this bug still there also for process.

I haven't fix sync because the structure is different, but there are also hardcoded maxsize=0 like here https://github.com/cgarciae/pypeln/blob/master/pypeln/sync/stage.py#L93 How should this be fixed?

Would be nice to have tests for this

@codecov-io
Copy link

codecov-io commented Jan 1, 2021

Codecov Report

Merging #66 (5d67864) into master (a93a9c4) will increase coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage   90.57%   90.77%   +0.20%     
==========================================
  Files          61       61              
  Lines        2100     2114      +14     
==========================================
+ Hits         1902     1919      +17     
+ Misses        198      195       -3     
Impacted Files Coverage Δ
pypeln/task/supervisor.py 97.22% <ø> (+2.77%) ⬆️
pypeln/process/stage.py 100.00% <100.00%> (ø)
pypeln/task/stage.py 98.33% <100.00%> (ø)
pypeln/task/utils.py 100.00% <100.00%> (ø)
pypeln/task/worker.py 95.89% <100.00%> (+1.44%) ⬆️
pypeln/thread/queue.py 96.15% <100.00%> (+0.37%) ⬆️
pypeln/thread/stage.py 100.00% <100.00%> (ø)
pypeln/thread/supervisor.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a93a9c4...5d67864. Read the comment docs.

@cgarciae
Copy link
Owner

cgarciae commented Jan 2, 2021

maxsize does not make sense in sync because there is no concurrency, everything is implemented as an iterator but parameters are kept for API compatibility (you should be able to switch between any module without changes).

@cgarciae
Copy link
Owner

cgarciae commented Jan 2, 2021

LGTM!

I discovered some areas of improvement while creating a test for this, the thread and task Workers / Supervisors got stuck if they weren't finished but being stopped by the GC. I created a short-term fix here but the solution involves having the done() methods not having to push DONE elements to the queue because put can block. Will open a separate PR.

@cgarciae cgarciae merged commit d6e84c9 into cgarciae:master Jan 2, 2021
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 this pull request may close these issues.

3 participants