Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tbc: fix race condition in fork tests #435

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

AL-CT
Copy link
Contributor

@AL-CT AL-CT commented Mar 11, 2025

Summary
Fixes a race condition that occurs due to multiple blockheader messages being sent to TBC before it has time to read them.

Changes

@github-actions github-actions bot added the area: tbc This is a change to TBC (Tiny Bitcoin) label Mar 11, 2025
Copy link
Contributor

@marcopeereboom marcopeereboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix this for real. Why is the write stepping on each other?

We need a mutex somewhere.

@AL-CT AL-CT marked this pull request as ready for review March 12, 2025 23:36
@AL-CT AL-CT requested a review from a team as a code owner March 12, 2025 23:36
@AL-CT AL-CT requested a review from marcopeereboom March 12, 2025 23:36
Copy link
Contributor

@marcopeereboom marcopeereboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adheres to the readers read, writers write idiom. I recall reasoning through that when I wrote it and argued the long mutex away in writes. That was a mistake on my end. Apologies to the poor CI that suffered through this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tbc This is a change to TBC (Tiny Bitcoin)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants