:: Re: [Libbitcoin] network connection…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Amir Taaki
Ημερομηνία:  
Προς: libbitcoin
Αντικείμενο: Re: [Libbitcoin] network connection algorithm
The network flow is something like:

at the start call try_outbound_connects() which does a for loop calling
try_connect_once() N times.

1. try_connect_once()
hosts.fetch_address()
2. attempt_connect()
FAIL: try_connect_once()
connect()
3. handle_connect()
FAIL: try_connect_once()
setup_new_channel() / subscribe_stop()
4. channel_stopped()
try_connect_once()

so I'm not sure where it is creating +1 connections. there should be N
slots that are always reconnecting and that's it. but for some reason it
manages to get past 8 to 9 connection attempts.

On 11/12/13 15:37, Amir Taaki wrote:
> yep I got the same too (same line). I'm investigating this.
>
> On 11/12/13 14:50, Noel Maersk wrote:
>> On Tue, Dec 10, 2013 at 02:29:22AM +0000, Amir Taaki wrote:
>>> I've changed the way libbitcoin connects to a more saner policy. There
>>> are now a fixed number of slots and it always tries to maintain a
>>> constant amount of connections. Before it was aggressively chasing
>>> connections which was poorly thought out.
>>>
>>> https://github.com/spesmilo/libbitcoin/commit/06cc1a3c36ed41706c79e222398e9778081b7d6f
>>>
>>> It might be more unstable because there are more asserts, but they will
>>> help catch out any deeper bugs in the network code.
>>>
>>
>> Yesterday, obworker eventually exited with
>>
>> obworker: network/protocol.cpp:305: void
>> libbitcoin::protocol::handle_connect(const std::error_code&,
>> libbitcoin::channel_ptr, const libbitcoin::network_address_type&):
>> Assertion `connections_.size() <= max_outbound_' failed.
>>
>> on both my machines (Debian Wheezy and Arch Linux). Sadly, I didn't have
>> a timestamp as to how soon this happened.
>>
>> Restarted again now, let's see if it's still present with the updated
>> latest.
>>
>> P.S. On the Debian machine, I already see it's reporting having gone to
>> 9 connections, but hasn't exited.
>>
>>
>>
>> _______________________________________________
>> Libbitcoin mailing list
>> Libbitcoin@???
>> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/libbitcoin
>>
>
>
>
> _______________________________________________
> Libbitcoin mailing list
> Libbitcoin@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/libbitcoin
>