Skip to content

[fix]: Fix ReactorNettyWebSocketClient builder reuse in WebSocket plugin configuration#6330

Merged
Aias00 merged 4 commits intoapache:masterfrom
zhaoguhong:codex/fix-issues-in-websocketpluginconfiguration
Apr 24, 2026
Merged

[fix]: Fix ReactorNettyWebSocketClient builder reuse in WebSocket plugin configuration#6330
Aias00 merged 4 commits intoapache:masterfrom
zhaoguhong:codex/fix-issues-in-websocketpluginconfiguration

Conversation

@zhaoguhong
Copy link
Copy Markdown
Contributor

Motivation

WebSocketPluginConfiguration currently passes a mutable WebsocketClientSpec.Builder in a way that may cause builder state to be reused across WebSocket handshakes.

Following the same approach discussed in Spring Cloud Gateway issue #2215 / PR #2216, each handshake should use a fresh builder instance to avoid cross-request state leakage.

Description

  • Updated WebSocketPluginConfiguration#reactorNettyWebSocketClient to provide a Supplier<WebsocketClientSpec.Builder> that creates a new builder on each invocation.
  • Extended the existing testReactorNettyWebSocketClient (as requested) to verify behavior by checking that the internal builder supplier returns different builder instances across calls.

Related Links

Copy link
Copy Markdown
Contributor

@Aias00 Aias00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aias00 Aias00 merged commit fb454de into apache:master Apr 24, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants