Skip to content

Prevent socket leak in ThreadSocketHandler. - #4037

Merged
gmaxwell merged 2 commits into
bitcoin:masterfrom
gmaxwell:fdleaks
Apr 18, 2014
Merged

gmaxwell merged 2 commits into
bitcoin:masterfrom
gmaxwell:fdleaks

Conversation

@gmaxwell

@gmaxwell gmaxwell commented Apr 9, 2014

Copy link
Copy Markdown
Contributor

When we are over our outbound limit ThreadSocketHandler would try to
keep the connection if the peer was addnoded.

This didn't actually work for two reasons: It didn't actually run
the accept code due to mistaken code flow, and because we have a
limited number of outbound semaphores it couldn't actually use the
connection.

Instead it leaked the socket, which might have caused issue #4034.

This patch just takes out the non-functioning white-listing for now.

When we are over our outbound limit ThreadSocketHandler would try to
 keep the connection if the peer was addnoded.

This didn't actually work for two reasons: It didn't actually run
 the accept code due to mistaken code flow, and because we have a
 limited number of outbound semaphores it couldn't actually use the
 connection.

Instead it leaked the socket, which might have caused issue #4034.

This patch just takes out the non-functioning white-listing for now.
@gmaxwell

gmaxwell commented Apr 9, 2014

Copy link
Copy Markdown
Contributor Author

I'd like to bring the intended functionality back too but it requires reworking out the outbound semaphores work and I wanted to get a fix up the user reporting 4034 could test. Since it never worked at all, I didn't think adding the functionality was a top priority.

@BitcoinPullTester

Copy link
Copy Markdown

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/0bd05b53b155bc28b6e5dfd967cafaafb44a439f for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@laanwj

laanwj commented Apr 18, 2014

Copy link
Copy Markdown
Member

ACK

1 similar comment
@sipa

sipa commented Apr 18, 2014

Copy link
Copy Markdown
Member

ACK

gmaxwell added a commit that referenced this pull request Apr 18, 2014
Prevent socket leak in ThreadSocketHandler.
@gmaxwell
gmaxwell merged commit fe451fe into bitcoin:master Apr 18, 2014
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants