8000 gh-127840: pass flags and address from send_fds by mbachry · Pull Request #127841 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127840: pass flags and address from send_fds #127841

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 4 commits into from
May 22, 2025

Conversation

mbachry
Copy link
Contributor
@mbachry mbachry commented Dec 11, 2024

The new test is a copy of the existing test using socketpair. Let me know if I should refactor and merge these two somehow.

@ghost
Copy link
ghost commented Dec 11, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link
bedevere-app bot commented Dec 11, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link
Member
@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Happy to see new contributors 😄

@ZeroIntensity ZeroIntensity added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Dec 12, 2024
mbachry and others added 2 commits December 12, 2024 19:03
…t8fiQ.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Copy link
Member
@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@gpshead, as one of the socket experts, would you mind reviewing?

@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
@gpshead gpshead removed the needs backport to 3.12 only security fixes label May 22, 2025
@gpshead gpshead merged commit 518c95b into python:main May 22, 2025
50 checks passed
@miss-islington-app
Copy link

Thanks @mbachry for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2025
socket: pass flags and address from send_fds
(cherry picked from commit 518c95b)

Co-authored-by: Marcin Bachry <hegel666@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2025
socket: pass flags and address from send_fds
(cherry picked from commit 518c95b)

Co-authored-by: Marcin Bachry <hegel666@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented May 22, 2025

GH-134474 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 22, 2025
@bedevere-app
Copy link
bedevere-app bot commented May 22, 2025

GH-134475 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 22, 2025
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 CentOS9 NoGIL 3.x (tier-1) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1609/builds/2712) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1609/builds/2712

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.itamaro-centos-aws.nogil/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=5, family=1, type=2, proto=0, laddr=./test_python_qkt9f__m.sock>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.itamaro-centos-aws.nogil/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python__7ampq2z.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM Raspbian 3.x (tier-3) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/424/builds/10802) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/424/builds/10802

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_pbof1ewy.sock>
k


Traceback (most recent call last):
  File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_c4s0l6jd.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.x (tier-2) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/725/builds/11042) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/725/builds/11042

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=26, family=1, type=2, proto=0, laddr=./test_python_wz11kla7.sock>
k


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=26, family=1, type=2, proto=0, laddr=./test_python_i_w9uwih.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Debian Non-Debug with X 3.x (no tier) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1245/builds/5543) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1245/builds/5543

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_ohnp943n.sock>
�[32mok�[0m


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=5, family=1, type=2, proto=0, laddr=./test_python_widcf142.sock>
�[32mok�[0m

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 FreeBSD14 3.x (tier-3) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1232/builds/5887) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1232/builds/5887

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=5, family=1, type=2, proto=0, laddr=./test_python__er5v_tk.sock>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_ooydm3gw.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 MacOS Intel NoGIL 3.x (tier-1) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1258/builds/5081) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1258/builds/5081

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=9, family=1, type=2, proto=0, laddr=./test_python_q4t3ldap.sock>
k


Traceback (most recent call last):
  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-intel-aws.nogil/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=8, family=1, type=2, proto=0, laddr=./test_python_059fgnzk.sock>
k

@gpshead
Copy link
Member
gpshead commented May 22, 2025

hmm, probably need to revert this while figuring those out...

gpshead added a commit to gpshead/cpython that referenced this pull request May 22, 2025
@gpshead
Copy link
Member
gpshead commented May 22, 2025

#134482

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 Raspbian 3.x (tier-3) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1678/builds/116) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1678/builds/116

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian.nondebug/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=5, family=1, type=2, proto=0, laddr=./test_python_xg5dcebk.sock>
k


Traceback (most recent call last):
  File "/home/stan/buildarea/3.x.stan-raspbian.nondebug/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_w7b6g3fn.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x (no tier) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/469/builds/11175) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/469/builds/11175

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_ht3a1kva.sock>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=5, family=1, type=2, proto=0, laddr=./test_python_s5youw7c.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Ubuntu Shared 3.x (tier-1) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/506/builds/10726) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/506/builds/10726

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=6, family=1, type=2, proto=0, laddr=./test_python_qamhsx8n.sock>
k


Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=5, family=1, type=2, proto=0, laddr=./test_python_r4fctla0.sock>
k

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 macOS 3.x (tier-1) has failed when building commit 518c95b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/366/builds/9576) and take a look at the build logs.
  4. Check if the failure is related to this commit (518c95b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/366/builds/9576

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=26, family=1, type=2, proto=0, laddr=./test_python_fj5uabmh.sock>
k


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/unittest/case.py", line 615, in _callTestMethod
    result = method()
ResourceWarning: unclosed <socket.socket fd=26, family=1, type=2, proto=0, laddr=./test_python_xtxh8y64.sock>
k

gpshead added a commit that referenced this pull request May 22, 2025
…H-127841)" (#134482)

Revert "gh-127840: pass flags and address from send_fds (GH-127841)"

This reverts commit 518c95b.
@mbachry
Copy link
Contributor Author
mbachry commented May 22, 2025

hmm, probably need to revert this while figuring those out...

Right, sorry about that. Forgot to wrap that socket in a context manager in a test case. It's a pity that local make test and CI pass and this trivial error is revealed only after merging. make test TESTPYTHONOPTS=-Werror reproduces the issue locally, but I'm not able to run the entire test suite with warnings on, so it's not a viable permanent solution.

In any case, it's a simple fix, so I can open another pr.

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.

5 participants
0