8000 Disable GCCollector in multiprocess mode by akx · Pull Request #324 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Disable GCCollector in multiprocess mode #324

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

Merged
merged 2 commits into from
Oct 11, 2018

Conversation

akx
Copy link
Contributor
@akx akx commented Oct 11, 2018

To avoid deadlocks (#322), disable the GC collector in multiprocess mode.

@@ -6,3 +6,6 @@ dist
.coverage.*
.coverage
.tox
.*cache
Copy link
Contributor

Choose a reason for hiding this comment

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

The projects policy is that such things belong in your global gitignore, rather than us ending up with everything in ours.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm willing to move .idea to my global gitignore, sure.

Since .coverage.* and .tox, which are generated by running tests, are in here, it makes sense that htmlcov and .*cache (to target .pytest_cache, as used by newer versions of py.test, and .cache`, to target older ones) that are similarly generated by running tests, are in here too.

import time

from . import core

class GCCollector(object):
"""Collector for Garbage collection statistics."""
def __init__(self, registry=core.REGISTRY, gc=gc):
if 'prometheus_multiproc_dir' in os.environ:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment with a link to the issue? We can revert this once it's fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done deal.

@akx akx force-pushed the disable-gc-in-multiproc branch from 2385c7a to 7bda793 Compare October 11, 2018 10:24
@brian-brazil
Copy link
Contributor

Can you add the DCO please?

akx added 2 commits October 11, 2018 13:33
Signed-off-by: Aarni Koskela <akx@iki.fi>
Works around prometheus#322

Signed-off-by: Aarni Koskela <akx@iki.fi>
@akx akx force-pushed the disable-gc-in-multiproc branch from 7bda793 to 0245928 Compare October 11, 2018 10:33
@akx
Copy link
Contributor Author
akx commented Oct 11, 2018

DCO done.

@brian-brazil brian-brazil merged commit 48cbd38 into prometheus:master Oct 11, 2018
@brian-brazil
Copy link
Contributor

Thanks!

@akx akx deleted the disable-gc-in-multiproc branch October 11, 2018 11:47
@xavfernandez
Copy link
Contributor

A patch release with this PR would be nice 👍
Any idea when this could be done ?

xavfernandez pushed a commit to Polyconseil/client_python that referenced this pull request Oct 15, 2018
* Add Pytest cache and Coverage HTML report dirs to gitignore
* Disable the GC collector in multiprocess mode

Works around prometheus#322

Signed-off-by: Aarni Koskela <akx@iki.fi>
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
0