apupier opened a new pull request, #29453:
URL: https://github.com/apache/camel/pull/29453
# Description
Fixes the flaky
`XmppProducerReconnectTest.groupChatProducerEntersItsRoomAgainWhileAnotherUserIsStillLoggingTheConnectionIn`
(9 failures and 32 flaky runs out of ~70 on Develocity), introduced by
6705f9c9985d (CAMEL-25961).
**Cause:** `XmppGroupChatProducer` set `rejoinRoom = !resumed` in the
`authenticated` listener of the connection. When another user of the shared
account, or Smack's `ReconnectionManager`, logs the connection in, Smack
reports the connection as logged in before it calls the authenticated
listeners. The producer then entered its room again on the next message, and
when the `authenticated` listener was called afterwards it set `rejoinRoom` a
second time. The following message made the producer join a room Smack already
considers joined: `MultiUserChat.join()` leaves the room first and enters it
again, which can time out after the 5s reply timeout with a
`NoResponseException` ("Could not send XMPP message ... No response received
within reply timeout").
**Fix:** `rejoinRoom` is already set when the connection is lost
(`connectionClosed` / `connectionClosedOnError`), before any new login can
happen, so the `authenticated` listener no longer needs to set it. It now only
clears it when the stream was resumed, as a resumed stream keeps the room
membership.
I could not reproduce the flake locally (the test passed repeatedly, also
under CPU load), so the root cause comes from analysing the stack trace, the
producer code and Smack's `MultiUserChat` sources. The existing camel-xmpp
tests all pass; please check the Develocity flaky rate of this test after the
merge.
# Target
- [x] I checked that the commit is targeting the correct branch (Camel 4
uses the `main` branch)
# Tracking
- [x] If this is a large change, bug fix, or code improvement, I checked
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for
the change (usually before you start working on it).
# Apache Camel coding standards and style
- [x] I checked that each commit in the pull request has a meaningful
subject line and body.
- [x] I have run `mvn clean install -DskipTests` locally from root folder
and I have committed all auto-generated changes.
---
_Claude Code on behalf of apupier_ — correction: this description was
generated by IBM Bob 2.2.1 on behalf of @apupier.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]