-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR) #79370
Comments
According to https://www.python.org/dev/peps/pep-0475/ the EINTR interruption should be retried automatically, but somehow it does not work and the exception is raised: 2018-11-05 05:21:35,257 ERROR:storage(23491): Remote storage operation failed (request: '{ 'excludeSubModules': None,
'storageLocation': 'qt/qtdatavis3d/68faa5b00f73096eb096c6acdfce76b052ca20b9/LinuxUbuntu_18_04x86_64LinuxQEMUarm64GCCqtci-linux-Ubuntu-18.04-x86_64-a6
c9f7Release/ac4280d182ec320eaf0e68efaeeeb6be14b9689f/test_1542834179',
'type': 3}')
Traceback (most recent call last):
File "src/storage.py", line 507, in handle
self.handle_upload_artifact(message)
File "src/storage.py", line 437, in handle_upload_artifact
log.info("upload of %s to %s", uploadType, message.storageLocation)
File "/usr/lib/python3.6/logging/__init__.py", line 1306, in info
self._log(INFO, msg, args, **kwargs)
File "/usr/lib/python3.6/logging/__init__.py", line 1442, in _log
self.handle(record)
File "/usr/lib/python3.6/logging/__init__.py", line 1452, in handle
self.callHandlers(record)
File "/usr/lib/python3.6/logging/__init__.py", line 1514, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.6/logging/__init__.py", line 861, in handle
self.acquire()
File "/home/vmbuilder/qt-ci/src/application.py", line 151, in acquire
fcntl.lockf(self._lock_fd, fcntl.LOCK_EX)
InterruptedError: [Errno 4] Interrupted system call |
You're right, it should, but the fcntl module hasn't been patched. Are you interested to work or on patch, or do you want to me to find someone to do it? |
My colleague has made a prospective fix: |
Oh, nice! Please rebase this change on the master branch and reuse "int async_err = 0;" pattern from Modules/posixmodule.c. You must not raise a new exception if PyErr_CheckSignals() raised an exception, something like:
|
PR waits for CLA |
Thanks Aapo Samuli Keskimolo for the bug report and thanks Nierob for the fix! |
I have not looked at 3.6, but I have bisected the 3.7 and 3.8 branches for AIX. I get: On 3.7 Branch: On 3.8 Branch: So, my assumption is that the PR-10413 is not 100% correct for AIX. Will look further, but also request - will this issue reopen, or do we need a new issue? |
Forgot to include the test failure message: ====================================================================== Traceback (most recent call last):
File "/data/prj/python/git/python3-3.8/Lib/test/test_eintr.py", line 18, in test_all
script_helper.assert_python_ok("-u", tester)
File "/data/prj/python/git/python3-3.8/Lib/test/support/script_helper.py", line 157, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "/data/prj/python/git/python3-3.8/Lib/test/support/script_helper.py", line 143, in _assert_python
res.fail(cmd_line)
File "/data/prj/python/git/python3-3.8/Lib/test/support/script_helper.py", line 70, in fail
raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: ['/data/prj/python/python3-3.8/python', '-X', 'faulthandler', '-I', '-u', '/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py'] stdout: --- stderr: Traceback (most recent call last):
File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", line 522, in test_lockf
self._lock(fcntl.lockf, "lockf")
File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", line 507, in _lock
lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
PermissionError: [Errno 13] Permission denied Ran 24 tests in 9.692s FAILED (errors=1, skipped=3) ---------------------------------------------------------------------- Ran 1 test in 10.404s FAILED (failures=1) == Tests result: FAILURE == 1 test failed: Total duration: 10 sec 645 ms |
The "improved" output after getting back to "latest" commit: == CPython 3.8.0a0 (heads/master-dirty:34ae04f74d, Dec 27 2018, 14:05:08) [C] ====================================================================== Traceback (most recent call last):
File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", line 522, in test_lockf
self._lock(fcntl.lockf, "lockf")
File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", line 507, in _lock
lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
PermissionError: [Errno 13] Permission denied Ran 24 tests in 8.822s FAILED (errors=1, skipped=3) ====================================================================== Traceback (most recent call last):
File "/data/prj/python/git/python3-3.8/Lib/test/test_eintr.py", line 31, in test_all
self.fail("eintr_tester.py failed")
AssertionError: eintr_tester.py failed Ran 1 test in 9.392s FAILED (failures=1) == Tests result: FAILURE == 1 test failed: Total duration: 9 sec 609 ms |
On 27/12/2018 15:48, Michael Felt wrote:
> Traceback (most recent call last):
> File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", line 522, in test_lockf
> self._lock(fcntl.lockf, "lockf")
> File "/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py", line 507, in _lock
> lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
> PermissionError: [Errno 13] Permission denied
>
>
> Traceback (most recent call last):
> File "/data/prj/python/git/python3-3.8/Lib/test/test_eintr.py", line 31, in test_all
> self.fail("eintr_tester.py failed")
> AssertionError: eintr_tester.py failed
>
>
I have been doing reading and debugging. Question: does mode "wb" imply also open for reading? Both Freebsd and Further, AIX talks about "enforced" and "advisory" locks, as well as Regards, Michael |
Michael created bpo-35633: test_eintr: test_lockf() fails with "PermissionError: [Errno 13] Permission denied" on AIX. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: