Skip to content

Bugfix: race condition between bootstrap pull and push #3720

@dsiganos

Description

@dsiganos

The unit test bootstrap_processor.push_one fails intermittently and it exposes a race condition in the bootstrap code of the node.
#3533

The race condition is that after finishing with bootstrap frontiers pull, the code is supposed to put the socket back into the idle boostrap connections queue. However it does that in a racy way. The problem is in function nano::frontier_req_client::received_frontier.

Near the bottom of that function, we should call:
connection->connections.pool_connection (connection);
before calling
promise.set_value (false);

Once the promise is given a value then nano::bootstrap_attempt_legacy::run continues to call push_request in parallel with pool_connection and it is a race condition.

Although this is a bug, this is likely not a major nor catastrophic bug because the bootstrap functionality is only an efficiency.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions