apache / apache/shenyu

[BUG] Sync-data-center: no queues, no batching, no dedup on the gateway side

Open
#6,587 1 comment 0 reactions 0 assignees View on GitHub
data-sync: websocket priority: medium type: performance
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

## Description
There are no queues and no batching anywhere in the gateway-side sync path. A `MYSELF`/`REFRESH` payload containing the entire namespace deserializes and re-caches every entry inline on the `onMessage` thread. No event dedup: `AbstractDataHandler.handle` always re-applies (`doUpdate`/`doRefresh`) regardless of whether the data actually changed — admin churn translates 1:1 into gateway CPU. A slow plugin handler stalls all subsequent config updates for that gateway.

## Location
```
shenyu-sync-data-websocket/.../client/ShenyuWebsocketClient.java:189-207,267-274
WebsocketDataHandler.java:67 -> AbstractDataHandler.java:62-85
AbstractNodeDataSyncService.java:212-253
```

## Impact
A single slow handler or a large burst saturates the one listener thread and silently delays all later config propagation; admin churn amplifies 1:1 into gateway CPU.

## Suggested fix
Add a bounded work queue + parallelism for config application; dedup by version/md5 before re-applying.

## Related existing issue(s)
#6461 (websocket reconnect) and #6523 (repeated successful polls) are specific defects; this is the structural lack of gateway-side queueing/dedup that amplifies them.

_Identified during the 2026-08-02 audit; full list in [`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ShenyuWebsocketClient.java:189-207,267-274 and trace WebsocketDataHandler.java:67 into AbstractDataHandler.java:62-85 and AbstractNodeDataSyncService.java:212-253. Determine how message handling currently applies updates and refreshes inline, then define bounded queueing, parallel application, and version/md5 deduplication; done means slow handlers and repeated unchanged events no longer block or reapply gateway configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.