File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
hivemq-edge/src/main/java/com/hivemq/protocols Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -221,14 +221,12 @@ private void cleanUpScheduler() {
221221 }
222222 }, WRITE_FUTURE_COMPLETE_DELAY , TimeUnit .SECONDS ));
223223 future .thenAccept (success -> cleanUpScheduler ());
224+ final var initialConnectionStatus = protocolAdapterState .getConnectionStatus ();
224225 protocolAdapterState .setConnectionStatusListener (status -> {
225- // Skip only the initial DISCONNECTED status on first call, but process any other status
226- // (including ERROR) immediately. This prevents race conditions where the adapter fails
227- // to connect before the listener is fully set up.
228- if (firstCallToStatusListener .compareAndSet (true , false ) &&
229- status == ProtocolAdapterState .ConnectionStatus .DISCONNECTED ) {
230- // Ignore initial DISCONNECTED status - adapter hasn't tried to connect yet
231- log .trace ("Ignoring initial DISCONNECTED status for adapter {}" , adapter .getId ());
226+ if (firstCallToStatusListener .compareAndSet (true , false ) && status == initialConnectionStatus ) {
227+ log .trace ("Ignoring initial status {} for adapter {}" ,
228+ initialConnectionStatus ,
229+ adapter .getId ());
232230 return ;
233231 }
234232
You can’t perform that action at this time.
0 commit comments