Frun1na opened a new pull request, #4876:
URL: https://github.com/apache/rocketmq-dashboard/pull/4876

   ## Which Issue(s) This PR Fixes
   
   - Fixes PENDING_BACKFILL
   
   ## Brief Description
   
   `sendWithReconnect` decided whether a terminated MCP session could be 
re-initialized from `transport.GetSessionId() != ""`. The mcp-go Streamable 
HTTP transport clears its stored session id as soon as any request fails with a 
404 (`sessionID.CompareAndSwap(sessionID, "")`), so a sender racing a 
concurrent 404 observed an empty id in its snapshot, skipped the reinitialize, 
and surfaced `ErrSessionTerminated` to the caller even though a reconnect was 
possible.
   
   The fix bases the decision on the recorded initialize request 
(`state.initialize != nil`) instead — it is exactly what `reinitialize` needs, 
it survives 404s, and the generation check inside `reinitialize` keeps 
concurrent senders serialized as before.
   
   ## How Did You Test This Change?
   
   Two new tests in `rmqctl/internal/studio/mcp_message_test.go`:
   
   - `TestSendWithReconnectRetriesAfterConcurrentSessionClear` 
deterministically reproduces the interleaving (snapshot taken after a 
concurrent 404 cleared the id). It fails on the base revision with `session 
terminated (404). need to re-initialize` and passes with the fix.
   - `TestSendWithReconnectConcurrent404sAllRecover` runs 8 concurrent senders 
against a stub that 404s everything until a fresh initialize; all must recover 
with exactly the CAS clearing semantics of mcp-go.
   
   ```
   $ go test ./internal/studio/ -run 'TestSendWithReconnect' -count=5 -race
   ok   github.com/apache/rocketmq-dashboard/rmqctl/internal/studio     1.047s
   
   $ make -C rmqctl ci
   ok   github.com/apache/rocketmq-dashboard/rmqctl/internal/catalog    1.023s
   ok   github.com/apache/rocketmq-dashboard/rmqctl/internal/catalog/generate   
1.057s
   ok   github.com/apache/rocketmq-dashboard/rmqctl/internal/config     1.047s
   ok   github.com/apache/rocketmq-dashboard/rmqctl/internal/output     1.021s
   ok   github.com/apache/rocketmq-dashboard/rmqctl/internal/studio     1.067s
   (catalog-verify, go vet, gofmt, cross-platform builds: all green)
   


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