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

   Fixes #7455
   
   ### Problem
   
   Disabling an asynchronous logging plugin closes its collector and consume 
client but retains the configuration in `Singleton`. Re-enabling with identical 
configuration skips client initialization and collector startup because 
`AbstractLogPluginDataHandler` checks configuration equality without checking 
the enable/disable lifecycle.
   
   ### Impact
   
   The plugin returns to the request chain, but logging remains stopped and 
subsequent logs are dropped while gateway requests continue.
   
   This affects the nine asynchronous logging handlers sharing this lifecycle: 
Aliyun SLS, ClickHouse, Elasticsearch, Huawei LTS, Kafka, Pulsar, RabbitMQ, 
RocketMQ, and Tencent CLS.
   
   ### Changes
   
   - Refresh the client and start the collector when the plugin ID is absent 
from `PLUGIN_GLOBAL_CONFIG_MAP`.
   - Reuse the existing lifecycle record: production code writes entries only 
in the enabled branch and removes them only in the disabled branch, which is 
also the sole production caller of collector `close()`. Already-enabled, 
unchanged configuration retains its entry and does not trigger reinitialization.
   - Remove the entry in `finally` during disable, including when collector 
close throws.
   - Add two shared-handler regression tests:
     - Enable → disable → re-enable identical configuration: verify both 
components restart, repeated enable does not reinitialize, and a log is 
consumed.
     - Mock a collector close failure: verify disable handles the exception and 
re-enable initializes the client and starts the collector again.
   - Update existing same-config tests for Aliyun SLS, ClickHouse, 
Elasticsearch, RabbitMQ, and Tencent CLS to establish an already-active entry 
and clean it up afterward.
   
   ### Validation
   
   - All 58 logging-common tests, including the two new regressions, and the 
full test suites of all nine affected plugin modules passed.
   - Full local `clean install` passed, including Checkstyle and Apache RAT 
checks.
   
   ### Checklist
   
   Make sure that:
   
   - [x] You have read the [[contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide)](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