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

   ## Description
   This PR fixes a FIXME comment in `ShenyuSseServerTransportProvider.java`. 
The javadoc for `closeGracefully()` claimed to use the `isClosing` flag to 
prevent new connections during shutdown, but the flag was never actually being 
set.
   
   ## Problem
   The FIXME comment (line 196-198) noted:
   ```java
   // FIXME: This javadoc makes claims about using isClosing flag but it's not
   // actually
   // doing that.
   ```
   
   The `closeGracefully()` method was not setting `isClosing = true`, which 
means new connections could potentially be accepted during the graceful 
shutdown process.
   
   ## Solution
   - Set `isClosing = true` at the start of `closeGracefully()` method
   - Update the javadoc to accurately describe the behavior
   - Remove the outdated FIXME comment
   
   ## Changes
   **File:** 
`shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/transport/ShenyuSseServerTransportProvider.java`
   
   ```java
   // Before
   public Mono<Void> closeGracefully() {
       return Flux.fromIterable(sessions.values())
           ...
   }
   
   // After
   public Mono<Void> closeGracefully() {
       isClosing = true;  // Now properly set!
       return Flux.fromIterable(sessions.values())
           ...
   }
   ```
   
   ## Testing
   - ✅ `./mvnw compile -pl shenyu-plugin/shenyu-plugin-mcp-server -am 
-DskipTests` passes
   
   ## Impact
   - **Risk:** Low - This is a bug fix that ensures proper shutdown behavior
   - **Backwards Compatible:** Yes - No API changes
   


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