BobSong-dev opened a new pull request, #7343:
URL: https://github.com/apache/shenyu/pull/7343
Fixes #7313
## Background
`WebsocketCollector.SessionSendQueue` advances only when the
`AsyncRemote.sendText` callback
runs. On a half-open connection the callback never fires: `sending` stays
true forever,
later messages pile up in an unbounded `ArrayDeque`, and nothing closes the
session or
requests reconciliation. A failed `SendResult` or a synchronous send
exception drops the
message but leaves the session open, so the gateway silently misses
configuration updates.
## Changes
- Schedule a per-send watchdog timeout (default 30s): if the callback is not
observed, the
session is treated as broken and closed;
- A failed `SendResult` or a synchronous send exception now closes the
session instead of
discarding the message and continuing;
- Bound the per-session queue (default 256 messages); overflow closes the
session rather
than silently dropping messages;
- Closing removes the session from all indexes and cancels pending timeouts;
the gateway
reconnects and performs a full `MYSELF` synchronization, which makes every
failure path
recoverable;
- Healthy sessions keep strict message ordering; test hooks allow tuning the
timeout and
queue limit.
## Verification
Local:
- `./mvnw test -pl shenyu-admin -Dtest=WebsocketCollectorTest`: 32 tests, 0
failures
(covers missing callback, failed callback, synchronous exception,
overflow, close race, ordering);
- `./mvnw test -pl shenyu-admin`: BUILD SUCCESS; Tests run: 1513, Failures:
0, Errors: 0, Skipped: 1;
- `./mvnw checkstyle:check -pl shenyu-admin`: passed.
--
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]