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

Get rid of RuntimeWarning when using process pool #732

Merged
merged 2 commits into from
Jan 8, 2022

Conversation

selitvin
Copy link
Collaborator

@selitvin selitvin commented Jan 7, 2022

Restructure process_pool implementation code in a way that resolves RuntimeWarning: 'petastorm.workers_pool.exec_in_new_process' found in sys.modules after import of package 'petastorm.workers_pool', but prior to execution of 'petastorm.workers_pool.exec_in_new_process'; this may result in unpredictable behaviou when using process pool warning.

In this diff we break main entry point from exec_in_new_process.py file into two a separate exec_in_new_process_entrypoint.py.

Resolves #585

@selitvin selitvin force-pushed the warning_in_process_pool branch from cd72f4d to 8d90bad Compare January 7, 2022 04:15
Restructure process_pool implementation code in a way that resolves `RuntimeWarning: 'petastorm.workers_pool.exec_in_new_process' found in sys.modules after
import of package 'petastorm.workers_pool', but prior to execution of 'petastorm.workers_pool.exec_in_new_process'; this may result in unpredictable behaviou when using process pool` warning.

In this diff we break main entry point from `exec_in_new_process.py` file into two a separate `exec_in_new_process_entrypoint.py`.

Resolves uber#585
@selitvin selitvin force-pushed the warning_in_process_pool branch from 8d90bad to 345aabb Compare January 7, 2022 04:15
@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #732 (0a7fb33) into master (de8dbde) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #732      +/-   ##
==========================================
+ Coverage   86.16%   86.17%   +0.01%     
==========================================
  Files          84       85       +1     
  Lines        5060     5065       +5     
  Branches      787      787              
==========================================
+ Hits         4360     4365       +5     
  Misses        560      560              
  Partials      140      140              
Impacted Files Coverage Δ
petastorm/workers_pool/exec_in_new_process.py 100.00% <ø> (ø)
...orm/workers_pool/exec_in_new_process_entrypoint.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 de8dbde...0a7fb33. Read the comment docs.

Copy link
Collaborator

@chongxiaoc chongxiaoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I don't even know this trick.

@selitvin selitvin merged commit 3dc8bab into uber:master Jan 8, 2022
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.

RuntimeWarning when using pure Python reader with process workers
2 participants