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

#35 open multiprocessing log in context handler #36

Merged
merged 4 commits into from
Aug 20, 2018

Conversation

codekiln
Copy link
Contributor

for #35 open multiprocessing log in context handler

@codecov
Copy link

codecov bot commented Aug 20, 2018

Codecov Report

Merging #36 into master will increase coverage by 4.99%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   64.16%   69.15%   +4.99%     
==========================================
  Files          19       19              
  Lines         879      885       +6     
  Branches      134      135       +1     
==========================================
+ Hits          564      612      +48     
+ Misses        266      219      -47     
- Partials       49       54       +5
Impacted Files Coverage Δ
..._migrations/utils/django_elastic_migrations_log.py 100% <100%> (ø) ⬆️
..._elastic_migrations/utils/multiprocessing_utils.py 67.86% <100%> (+38.77%) ⬆️

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 eb433b9...edfee88. Read the comment docs.

* update changelog
* add test stub for django elastic migrations log

#35 open multiprocessing log in context handler
#35 open multiprocessing log in context handler
start multiprocessing-logging to make each handler a synchronized queue.
Called by django_elastic_migrations.utils.multiprocessing_utils.DjangoMultiProcess.__enter__
See https://github.com/jruere/multiprocessing-logging/blob/master/multiprocessing_logging.py
TBD: uninstall mp_logging; currently we don't stop and reset mp logging; it's a one-shot for the process.
Copy link
Contributor

Choose a reason for hiding this comment

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

Question on this quote: "currently we don't stop and reset mp logging; it's a one-shot for the process."
Does this mean when you set mp_logging_enabled = True - it will still be activate even if you set it to False?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, mp_logging_enabled is set in this module and isn't meant to be set outside of it. There's currently no code that resets it to False once it's been set to True, because uninstalling multiprocessing logging isn't implemented or supported yet.

I've put in a feature request for that with multiprocessing_logging, which would involve making backups of all the logging and then reinstalling the backups after multiprocessing is complete.

This is really just a stub to prevent starting multiprocessing logging again if it's already initiated.

Copy link

@gnulnx gnulnx left a comment

Choose a reason for hiding this comment

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

Looks fine

@codekiln codekiln merged commit 1e4d4ad into master Aug 20, 2018
@codekiln codekiln deleted the #35_open_multiprocessing_log_in_context_handler branch August 20, 2018 15:21
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.

4 participants