Skip to content

[BUG] WebsocketSyncDataService.close() shuts down the shared WheelTimerFactory timer, breaking FailbackRegistryRepository #6785

Description

@Aias00
  • Severity: Medium
  • Location:
    shenyu-sync-data-center/shenyu-sync-data-websocket/src/main/java/org/apache/shenyu/plugin/sync/data/websocket/WebsocketSyncDataService.java:110 (timer = WheelTimerFactory.getSharedTimer()), :178 (timer.shutdown())

Description:
close() calls timer.shutdown() where timer is the JVM-wide singleton Timer from WheelTimerFactory.getSharedTimer(). The same shared timer is used by FailbackRegistryRepository (FailbackRegistryRepository.java:50: this.timer = WheelTimerFactory.getSharedTimer()). Shutting down the shared timer destroys the registration retry mechanism for all components that depend on it.

Impact:
If WebsocketSyncDataService is destroyed without full application shutdown (bean refresh, conditional reconfiguration), FailbackRegistryRepository's retry timer is killed, silently breaking registration retry.

Suggested fix:
Do not call timer.shutdown() in close(). Only cancel the service's own timerTask. Use WheelTimerFactory.newWheelTimer() for a private timer instance if shutdown is required.

Confidence: High

  • Related existing: none

Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/06-medium-tiers.md.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions