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

Python 3.4+: use os.set_inheritable + os.set_blocking in place of unreadable fcntl calls #3210

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

pajod
Copy link
Contributor

@pajod pajod commented May 12, 2024

We should cleanup those rather unreadable low-level fcntl calls. The stdlib provides single-call functions for these now.

(Replacement is not 100% equivalent, as they might call ioctl(.., FIO.., NULL) instead, but I see no reason we should care.)


Suggested order:

@pajod pajod marked this pull request as ready for review May 12, 2024 22:34
@benoitc benoitc self-assigned this Jun 14, 2024
@pajod pajod force-pushed the patch-fcntl-FD_CLOEXEC-ioctl-FIOCLEX branch from 3ab0385 to bc4fc46 Compare July 4, 2024 13:23
@pajod pajod marked this pull request as draft August 6, 2024 14:46
@benoitc
Copy link
Owner

benoitc commented Aug 8, 2024

Not disagreeing about this change but this must be validated on BSD. I think we need to add FreeBSD to our test platform to ensure it works there. (an dmaybe other OpenBSD).

@pajod pajod force-pushed the patch-fcntl-FD_CLOEXEC-ioctl-FIOCLEX branch 3 times, most recently from facf3b6 to 2551f70 Compare August 23, 2024 19:44
@pajod pajod force-pushed the patch-fcntl-FD_CLOEXEC-ioctl-FIOCLEX branch 5 times, most recently from b5a25e9 to 4831ef3 Compare August 23, 2024 20:39
@pajod
Copy link
Contributor Author

pajod commented Aug 23, 2024

@benoitc Happy with pulling Neil Pang's vm images?

Those work with very little setup required for FreeBSD, OpenBSD and illumos (no prebuilt gevent though). Though the Github file still needs review by someone more proficient with that:

  • I did not know how to express "whatever python3 version you usually do" on those images
  • I did not know if/how mixing GitHub CI secrets with running arbitrary untrusted code in another CI workflow can be done safely.
  • The actual test I meant to run did not run on those systems yet (thats what the s in tests/test_nginx.py s indicates) - my current nginx test does not produce very nice messages when failing
  • afaict, OmniOS does not ship gevent, so setup including compilation is rather slow / does not work because libev believes it is on linux and tries to prepare for the existing inotify.h with two-argument statfs() needs some autoconf override in the CI workflow

@pajod pajod force-pushed the patch-fcntl-FD_CLOEXEC-ioctl-FIOCLEX branch from 4831ef3 to 5632dc0 Compare August 23, 2024 20:56
@pajod pajod force-pushed the patch-fcntl-FD_CLOEXEC-ioctl-FIOCLEX branch from 5632dc0 to a452f12 Compare August 23, 2024 21:14
@pajod pajod force-pushed the patch-fcntl-FD_CLOEXEC-ioctl-FIOCLEX branch from f8bda39 to 0d03ef2 Compare September 8, 2024 21:45
@pajod pajod marked this pull request as ready for review September 9, 2024 10:57
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.

Missing test cases for workers
2 participants