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

Concurrency crash #776

Closed
duijf opened this issue Mar 22, 2019 · 1 comment
Closed

Concurrency crash #776

duijf opened this issue Mar 22, 2019 · 1 comment
Labels
C: packaging Installation and packaging of Black T: bug Something isn't working

Comments

@duijf
Copy link

duijf commented Mar 22, 2019

Operating system: Ubuntu Xenial (on Travis)
Python version: 3.6.8
Black version: 19.3b0
Does also happen on master: Haven't tested but when through the commits since the release. No commits seem to touch the codepath we're seeing here.

black crashes on certain system configurations due to multiprocessing. Here is the traceback we're seeing.

|Traceback (most recent call last):
|  File "/usr/local/lib/XXX/virtualenv/bin/black", line 11, in <module>
|    sys.exit(patched_main())
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/black.py", line 3754, in patched_main
|    main()
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/click/core.py", line 764, in __call__
|    return self.main(*args, **kwargs)
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/click/core.py", line 717, in main
|    rv = self.invoke(ctx)
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/click/core.py", line 956, in invoke
|    return ctx.invoke(self.callback, **ctx.params)
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/click/core.py", line 555, in invoke
|    return callback(*args, **kwargs)
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
|    return f(get_current_context(), *args, **kwargs)
|  File "/usr/local/lib/XXX/virtualenv/lib/python3.6/site-packages/black.py", line 435, in main
|    executor = ProcessPoolExecutor(max_workers=os.cpu_count())
|  File "/usr/lib/python3.6/concurrent/futures/process.py", line 402, in __init__
|    EXTRA_QUEUED_CALLS)
|  File "/usr/lib/python3.6/multiprocessing/context.py", line 102, in Queue
|    return Queue(maxsize, ctx=self.get_context())
|  File "/usr/lib/python3.6/multiprocessing/queues.py", line 42, in __init__
|    self._rlock = ctx.Lock()
|  File "/usr/lib/python3.6/multiprocessing/context.py", line 67, in Lock
|    return Lock(ctx=self.get_context())
|  File "/usr/lib/python3.6/multiprocessing/synchronize.py", line 162, in __init__
|    SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
|  File "/usr/lib/python3.6/multiprocessing/synchronize.py", line 59, in __init__
|    unlink_now)
|OSError: [Errno 30] Read-only file system

This only happens when running black on more than 1 file at a time. There should probably be an option (or codepath which tries to correct this issue) for serial execution.

@JelleZijlstra JelleZijlstra added T: bug Something isn't working C: packaging Installation and packaging of Black labels May 5, 2019
@ichard26
Copy link
Collaborator

ichard26 commented Jun 14, 2020

This should be closed as PR #1141 has been merged. I think the PR author forgot that the GitHub keyword has be behind every issue you want to auto-close:

should fix #1138 and #776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: packaging Installation and packaging of Black T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants