Repository navigation
Conversation
A connection attempt can succeed after the resolver thread finishes but before its result is published. SocketUtil could return no connection without collecting that result, causing intermittent failures. Track submitted attempts until their results are collected or the deadline expires.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the outgoing XMPP connection race fix.
No open issues 🎉
What changed in this PR
Fixes a race in outgoing XMPP connection handling where SocketUtil could miss a successful connection published after the resolver thread finished.
Changes:
- Extracts result collection into
awaitConnection, which waits until a connection succeeds, all submitted results are collected, or the deadline expires. - Adds regression tests for delayed result publication and a finished resolver with no connection attempts.
| File | Description |
|---|---|
xmppserver/src/test/java/org/jivesoftware/openfire/net/SocketUtilTest.java |
Tests delayed success after a failed attempt and the no-attempt case. |
xmppserver/src/main/java/org/jivesoftware/openfire/net/SocketUtil.java |
Tracks uncollected connection results beyond resolver termination. |
Review effort: Balanced
|
Green once, tempting fate and restarting. |
A connection attempt can succeed after the resolver thread finishes but before its result is published. SocketUtil could return no connection without collecting that result, causing intermittent failures. Track submitted attempts until their results are collected or the deadline expires.
Co-pilot suggested to me that this is a source of our CI flapping tests.