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

   <!-- Describe your PR here; e.g. Fixes #issueNo -->
   
   <!--
   Thank you for proposing a pull request. This template will guide you through 
the essential steps necessary for a pull request.
   -->
   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`.
   
   ## Summary
   
    1. NPE fix — SubscribeRepository.java                                       
                                                                                
    
     - remove(List<String> topics, Channel channel) previously called 
TOPIC_CHANNEL_FACTORY.get(topic).remove(channel) directly, which threw an NPE 
when the topic had no entry in the map. The fix fetches the channel list into a 
local variable and only removes the channel when the list is non-empty 
(CollectionUtils.isNotEmpty). Called from Unsubscribe.java:46. 
                                                                                
                                                                                
                        
     2. Unit tests — new SubscribeRepositoryTest.java                           
                                                                                
                        
     - removeRemovesChannelFromExistingTopic — subscribes a channel, removes 
it, awaits until the topic's channel list is empty                              
                           
     - removeAbsentTopicDoesNotThrow — removing from an absent topic throws no 
exception (awaits the async task via ForkJoinPool.awaitQuiescence) and leaves 
other topics' subscriptions intact 
   
   close [#6745](https://github.com/apache/shenyu/issues/6745)


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