Skip to content

Read concurrency#437

Open
Alrighttt wants to merge 7 commits into
masterfrom
matt/read-concurrency
Open

Read concurrency#437
Alrighttt wants to merge 7 commits into
masterfrom
matt/read-concurrency

Conversation

@Alrighttt

@Alrighttt Alrighttt commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Changes Manager.mu to sync.RWMutex to enable reads to run in parallel.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@github-project-automation github-project-automation Bot moved this to In Progress in Sia Jun 5, 2026
@Alrighttt

Copy link
Copy Markdown
Contributor Author

As discussed with Nate and Luke, I will be redesigning or removing the peer cancellation logic. Don't bother with review for now.

Comment thread syncer/peer.go Outdated
err error
// goroutines spawned for this peer can observe ctx.Done() to short-circuit when the peer is
// gone.
ctx context.Context

@n8mgr n8mgr Jun 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Go advises against keeping contexts on the struct because it can cause leaks. Contexts should be short-lived.

@Alrighttt Alrighttt force-pushed the matt/read-concurrency branch from eaf7c4c to db7a3a3 Compare June 9, 2026 12:23
@Alrighttt Alrighttt changed the title Read concurrency and peer cancellation Read concurrency Jun 9, 2026
@Alrighttt

Copy link
Copy Markdown
Contributor Author

I removed all code related to the peer cancellation mechanism.

@Alrighttt Alrighttt requested a review from n8mgr June 9, 2026 14:42
Comment thread chain/db.go
// calls. Buckets obtained via the DB inside fn must not be used
// after fn returns. Writes via the DB inside fn are not durable
// and may panic.
View(fn func(DB) error) error

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this makes me sad

maybe we could add a writeable flag on Bucket() instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants