Repository navigation
Conversation
The OkHttp client clears its connection before notifying it as lost. A call made by the auto reconnect client in between still saw it as connected, skipped the reconnection wait, and failed with IllegalStateException instead of waiting for the reconnection. The underlying client now throws NotConnectedException, an IllegalStateException raised before anything is sent. The auto reconnect client catches it, waits within the call timeout for the connection lost to be notified, then retries through the reconnection path. Reordering the notification would only narrow the window: a call can still read the connected state just before the drop. Refs IZIVIA#108
WampLoadTest opens 1000 clients and sends 10000 heartbeats: its outcome depends on the throughput of the machine, which a shared CI runner does not guarantee, so it failed builds unrelated to ocpp-wamp. The default test task now excludes it, and a dedicated loadTest task, not wired into check, runs it. The exclusion is a class filter rather than a JUnit tag, since coreProject() configures the JUnit Platform in a doFirst that could override tag options. Refs IZIVIA#108
The client handles incoming messages on the default dispatcher, and read its connection only once the handling ran. When the server closed the connection right after answering, as shutdown does once in-flight calls are answered, the close could clear the connection first: the call result was dropped and the pending call timed out. This made "shutdown should answer an in-flight inbound call before closing the connection" fail on every isolated run on dev, where the first parse of a fresh JVM is slow, and matches how "shutdown should reject an inbound call received while draining" failed on CI: the pending call timed out although the shutdown had answered it. The connection is now read on the websocket thread when the message is received. The new test holds the dispatcher threads until the close to open the window. Refs IZIVIA#108
Condition.await reports a timeout through its return value, which SonarCloud flags when ignored. The wait now fails the call as soon as it times out, instead of on the next deadline check: same outcome. Refs IZIVIA#108
|
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #108
AutoReconnectOcppWampClientnow waits for the reconnection, withincallTimeout, when a call races a dropped connection. The underlying client signals that case with a newNotConnectedException, raised before anything is sent.OkHttpOcppWampClientreads its connection when a message is received, so a call result that arrives right before the server closes is no longer dropped. This lost result made both shutdown tests from #122 fail: the in-flight one fails 6 out of 6 isolated runs ondevand 0 out of 6 here.WampLoadTestmoves out ofcheckinto./gradlew :ocpp-wamp:loadTest, and each fix has a test that forces its window open (1214 tests green, 10 runs of the module under CPU load green).