fix(client): wrap notify_stream in with_stale_connection_retry#155
Conversation
notify_stream was the only PGMQ call site on Pgbus::Client that bypassed with_stale_connection_retry, causing transient idle-socket TLS errors (SSL EOF, SSL SYSCALL) to propagate to callers instead of being absorbed by the one-shot retry that every other method uses. This wraps the body of notify_stream in with_stale_connection_retry with synchronized inside the retry (matching send_message and the rest of Client), so the ephemeral broadcast path has the same resilience as every other producer.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWraps the ChangesStale Connection Retry in notify_stream
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
notify_streamwas the only@pgmq.*call site onPgbus::Clientthat bypassedwith_stale_connection_retry, causing transient idle-socket TLS errors (SSL error: unexpected eof,SSL SYSCALL error) to propagate to callers — typically Rails requests,after_commitcallbacks, or event handlers using the ephemeral broadcast pathnotify_streambody inwith_stale_connection_retrywithsynchronizedinside the retry, matching the pattern used bysend_message,send_batch, and every other method onPgbus::ClientNo public API change, no configuration change, no migration.
Test plan
bundle exec rspec spec/pgbus/client/notify_stream_spec.rb— 8 examples, 0 failuresbundle exec rspec spec/pgbus/client_spec.rb— 116 examples, 0 failuresbundle exec rubocop lib/pgbus/client/notify_stream.rb spec/pgbus/client/notify_stream_spec.rb— cleanSummary by CodeRabbit
Bug Fixes
Tests