Skip to content

Collect all error messages before stopping pgstream#841

Open
kvch wants to merge 3 commits into
mainfrom
fix-collect-all-errors-from-workers
Open

Collect all error messages before stopping pgstream#841
kvch wants to merge 3 commits into
mainfrom
fix-collect-all-errors-from-workers

Conversation

@kvch
Copy link
Copy Markdown
Collaborator

@kvch kvch commented Jun 3, 2026

Description

Collect error messages from all workers before stopping pgstream because of an error.

Related Issue(s)

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

kvch and others added 3 commits June 3, 2026 11:50
Notify reads from notifyChan in a select; when Close() closes the channel
the loop received a nil msg and dereferenced msg.urls, panicking. Check
the channel's ok value and exit cleanly.

ProcessWALEvent had the same %w(<nil>) race fixed for the batch sender
in #372: concurrent callers could read notifyErr before the goroutine
that drained notifyDone set it. Set notifyErr before closing notifyDone
so every reader observes the same error.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/pkg/wal/processor/batch 83.82% (ø)
github.com/xataio/pgstream/pkg/wal/processor/webhook/notifier 86.61% (+1.15%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/pkg/wal/processor/batch/wal_batch_sender.go 82.83% (ø) 99 82 17
github.com/xataio/pgstream/pkg/wal/processor/webhook/notifier/webhook_notifier.go 85.39% (+1.49%) 89 (+2) 76 (+3) 13 (-1) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/xataio/pgstream/pkg/wal/processor/batch/wal_batch_sender_test.go
  • github.com/xataio/pgstream/pkg/wal/processor/webhook/notifier/webhook_notifier_test.go

@kvch kvch requested a review from exekias June 3, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Snapshot] Errors not notified properly

2 participants