lymerin opened a new pull request, #7539:
URL: https://github.com/apache/shenyu/pull/7539

   Fixes #7470
   
   ### Problem
   
   `MqttPluginDataHandler` starts a new MQTT server on every enabled 
configuration update without checking whether the listener is already running 
or the effective configuration has changed.
   
   Repeated updates on the same port cause bind failures and leak Netty 
event-loop groups. Updates to a different port leave the previous listener 
running. The disable path also relies on port probing instead of the server's 
lifecycle state, and configuration updates are not serialized.
   
   ### Changes
   
   - **MqttPluginDataHandler:** Synchronize configuration updates, preserve the 
active listener for equivalent configurations, restart on effective 
configuration changes, and replace port probing with lifecycle-based shutdown.
   - **MqttServerConfiguration:** Compare effective runtime settings, including 
encrypted passwords and normalized leak detector levels, without mutating the 
original configuration.
   - **MqttBootstrapServer:** Make start/shutdown idempotent and synchronized, 
restart inactive listeners after releasing old resources, and clean up 
resources on startup failure.
   - **Tests:** Cover repeated and concurrent updates, effective configuration 
changes, encrypted passwords, enable/disable cycles, startup failures and 
retries, closed-listener recovery, resource cleanup, and real MQTT connection 
behavior.
   
   ### Validation
   
   - Local Maven `clean install` completed successfully without failures.
   - MQTT module tests passed: **103 tests**, with **0 failures, 0 errors, and 
0 skipped**:
     - `shenyu-protocol-mqtt`: 87 tests.
     - `shenyu-plugin-mqtt`: 16 tests.
   - Checkstyle passed with **0 violations**.
   
   ### Checklist
   
   Make sure that:
   ### Checklist
   
   Make sure that:
   
   - [x] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [x] You submit test cases (unit or integration tests) that back your 
changes.
   - [x] Your local test passed `./mvnw clean install 
-Dmaven.javadoc.skip=true`.


-- 
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]

Reply via email to