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

Unclean teardown of multiprocessing pool with Python 3.8 #13

Open
himani1 opened this issue Apr 6, 2021 · 4 comments
Open

Unclean teardown of multiprocessing pool with Python 3.8 #13

himani1 opened this issue Apr 6, 2021 · 4 comments

Comments

@himani1
Copy link

himani1 commented Apr 6, 2021

Hi,
I am using mgzip.decompress() to decompress a byte string. Following is the warning that gets generated in the logs while using it:

File "/usr/lib/python3.8/multiprocessing/pool.py", line 265, in del
_warn(f"unclosed running multiprocessing pool {self!r}",
ResourceWarning: unclosed running multiprocessing pool <multiprocessing.pool.ThreadPool state=RUN pool_size=1>

@himani1 himani1 changed the title Unclean tears of multiprocessing pool with Python 3.8 Unclean teardown of multiprocessing pool with Python 3.8 Apr 6, 2021
@timhughes
Copy link

timhughes commented Apr 6, 2021

This may be fixed by #12 Try using the code from https://github.com/timhughes/mgzip/tree/tests

@himani1
Copy link
Author

himani1 commented Apr 6, 2021

@timhughes Thanks for the reply. I tried adding the code snippet:

if self.mode == WRITE:
                self.pool.close()
                self.pool.join()
            elif self.mode == READ:
                self.raw.close()

to the finally block of close(), but this doesn't help. The warning is still there.

@timhughes
Copy link

timhughes commented Apr 6, 2021 via email

@timhughes
Copy link

Can you try with https://github.com/pgzip/pgzip and if you still have the issue, please raise an issue there.

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

No branches or pull requests

2 participants