{{ message }}
gh-103092: Isolate socket - #103094
Merged
Merged
gh-103092: Isolate socket#103094
Conversation
25 tasks
kumaraditya303
approved these changes
Apr 4, 2023
Contributor
Author
|
There's some leaks that needs to be adressed: $ ./python.exe measure.py
before=46451, after=47809
before=47811, after=48549
before=48549, after=49287
before=49287, after=50025
before=50025, after=50763measure.pyimport gc
import sys
for _ in range(5):
gc.collect()
before = sys.gettotalrefcount()
import _socket
del sys.modules["_socket"]
del _socket
gc.collect()
after = sys.gettotalrefcount()
print(f"{before=}, {after=}")
# assert after == before... and these two: $ ./python.exe -m test -R : test_socket -m RecvmsgIntoSCMRightsStreamTest Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 1.96 Run tests sequentially
0:00:00 load avg: 1.96 [1/1] test_socket
beginning 9 repetitions
123456789
.........
test_socket leaked [10, 10, 10, 10] file descriptors, sum=40
test_socket failed (reference leak)
== Tests result: FAILURE ==
1 test failed:
test_socket
Total duration: 1.8 sec
Tests result: FAILURE
$ ./python.exe -m test -R : test_socket -m RecvmsgSCMRightsStreamTest Raised RLIMIT_NOFILE: 256 -> 1024
0:00:00 load avg: 2.52 Run tests sequentially
0:00:00 load avg: 2.52 [1/1] test_socket
beginning 9 repetitions
123456789
.........
test_socket leaked [10, 10, 10, 10] file descriptors, sum=40
test_socket failed (reference leak)
== Tests result: FAILURE ==
1 test failed:
test_socket
Total duration: 1.8 sec
Tests result: FAILURE |
Contributor
Author
|
Regarding #103094 (comment): the file descriptors leak on |
Contributor
Author
|
Seems like the leaks are due to the capsulated C API not being freed. |
Contributor
Author
|
I'd like to hold this PR until #103261 has landed. |
erlend-aasland
marked this pull request as ready for review
April 8, 2023 19:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.