Current PyBitmessage establishes more outbound connections than set by 'maxoutboundconnections' #1763

Open
opened 2021-05-23 21:14:14 +02:00 by g1itch · 3 comments
g1itch commented 2021-05-23 21:14:14 +02:00 (Migrated from github.com)

Hello!

Lately I constantly see 10 outbound connections on the "Network Status" tab of my PyBitmessage while 'maxoutboundconnections' is set to default 8. I added additional check to TestCore.test_bootstrap() and reproduced the issue in https://travis-ci.org/github/g1itch/PyBitmessage/builds/772095631.

Hello! Lately I constantly see 10 outbound connections on the "Network Status" tab of my PyBitmessage while 'maxoutboundconnections' is set to default 8. I added additional check to `TestCore.test_bootstrap()` and reproduced the issue in https://travis-ci.org/github/g1itch/PyBitmessage/builds/772095631.
g1itch commented 2021-05-31 22:42:15 +02:00 (Migrated from github.com)

The test is incorrect though.

The test is incorrect though.
PeterSurda commented 2021-08-27 16:31:49 +02:00 (Migrated from github.com)

Well since multiple connections are made in parallel and asynchronously, it could be that some finish connecting after new ones are stopped being made. Should it then drop some later after it happens? And at what stage should it be checked? At fully_established, after receiving addresses, after receiving invs, after pending objects is zero? And which should be dropped? The ones that connected last? Or ones that are slow? Or some other mechanism?

Well since multiple connections are made in parallel and asynchronously, it could be that some finish connecting after new ones are stopped being made. Should it then drop some later after it happens? And at what stage should it be checked? At `fully_established`, after receiving addresses, after receiving invs, after pending objects is zero? And which should be dropped? The ones that connected last? Or ones that are slow? Or some other mechanism?
g1itch commented 2021-08-27 16:57:56 +02:00 (Migrated from github.com)

Yea, I see, it opens from 4 to 64 connections at a time and some of them got established when there are already 8 connections. The solution may be to change the range (e.g. using min(state.maximumNumberOfHalfOpenConnections, BMConfigParser().safeGetInt('bitmessagesettings', 'maxoutboundconnections')) - pending). But my problem currently is that I cannot write a proper test.

Yea, I see, it opens from 4 to 64 connections at a time and some of them got established when there are already 8 connections. The solution may be to change [the range](https://github.com/Bitmessage/PyBitmessage/blob/v0.6/src/network/connectionpool.py#L292) (e.g. using `min(state.maximumNumberOfHalfOpenConnections, BMConfigParser().safeGetInt('bitmessagesettings', 'maxoutboundconnections')) - pending`). But my problem currently is that I cannot write a proper test.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2024-12-12#1763
No description provided.