Skip to content

#9944 Merge WebSocketCloseFrameHandler into WebSocketProtocolHandler … - #9967

Merged
normanmaurer merged 2 commits into
netty:4.1from
doom369:merge_close_web_socket_handler
Jan 28, 2020
Merged

normanmaurer merged 2 commits into
netty:4.1from
doom369:merge_close_web_socket_handler

Conversation

@doom369

@doom369 doom369 commented Jan 25, 2020 •

Copy link
Copy Markdown
Contributor

…in order to minimize pipeline

Motivation:

Handling of WebSocketCloseFrame is part of websocket protocol, so it's logical to put it within the WebSocketProtocolHandler. Also, removal of WebSocketCloseFrameHandler will decrease the channel pipeline.

Modification:

  • WebSocketCloseFrameHandler code merged into WebSocketProtocolHandler. WebSocketCloseFrameHandler not added to the pipeline anymore
  • Added additional constructor to WebSocketProtocolHandler
  • WebSocketProtocolHandler now implements ChannelOutboundHandler and implements basic methods from it

Result:

WebSocketCloseFrameHandler is no longer used.

Fixes #9944

@doom369
doom369 requested a review from normanmaurer January 25, 2020 23:07
@netty-bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@normanmaurer

Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer
normanmaurer merged commit fb3ced2 into netty:4.1 Jan 28, 2020
@normanmaurer

Copy link
Copy Markdown
Member

@doom369 thanks a lot!

@normanmaurer normanmaurer added this to the 4.1.46.Final milestone Jan 28, 2020
He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 17, 2026
Motivation:
WebSocket close waits currently use a fixed three-second setting and a
periodic tick, even while connections are not closing. Applications need
to tune close-handshake waits without changing other timeout settings.

Modification:
Expose the positive client/server close timeout (maximum one hour) via
config and the Scala and Java settings APIs. Preserve three seconds by
default and for legacy config snippets. Arm a one-shot timer only while
waiting for peer Close or transport closure; keep the original budget
for a client transitioning between those phases. Keep the legacy stack
entry points and default getter, route settings-aware callers through
the configured value, use the shared Java duration converter, and
document the client behavior.

Result:
Both endpoints honor the configured wait with no periodic work on open
connections. Existing idle timeout semantics are unchanged. Timer
delivery remains subject to scheduler granularity.

Tests:
- Strict Scala 2.13.18 compilation of the six affected production sources
  and three affected specifications against cached dependencies: passed.
- Eight settings cases and two directional client/server close cases:
  passed; both directional cases fail against original-main wiring.
- Targeted MiMa against the exact baseline: zero findings.
- Cached Scalafmt and git diff --check: passed.
- Full repository CI and cross-Scala build not run locally.

References:
Refs apache#1486 and Netty netty/netty#8896, netty/netty#9967 (independent Pekko implementation).
He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 17, 2026
Motivation:
Allow applications to tune the current fixed three-second close wait
without changing the idle timeout or adding work to open connections.

Modification:
Configure the client and server close wait with Scala and Java settings
and a finite positive range up to one hour. Arm one timer while closing;
reuse the remaining time when an active client receives the peer Close
but still waits for transport closure. Route standard stack calls
through settings and remove the dead internal tick and default getter.
Keep the legacy messageAPI parameter with an explicit unused annotation.
Document the default, bounds and scheduler granularity.

Result:
Normal traffic has no periodic close check, and a client's two closing
phases share one configured budget. The default remains three seconds.

Tests:
- Strict Scala 2.13.18 production/test compile against cached modules.
- Eight settings cases and normal client/server configurable close
  cases passed in the first review round; the old wiring fails both.
- Current focused client configurable close and shared-budget cases
  passed; the shared-budget case fails when the timer restarts.
- Targeted MiMa with a freshly compiled source baseline reports zero.
  Two obsolete implementation-only symbols are intentionally removed.
- Scalafmt and git diff --check passed; full CI not run locally.

References:
Refs apache#1486, netty/netty#8896 and netty/netty#9967 (independent implementation).
He-Pin added a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 17, 2026
Motivation:
Allow applications to tune the fixed three-second close wait without
changing the idle timeout or adding work to open connections.

Modification:
Configure the client and server close wait with Scala and Java settings
and a finite positive range up to one hour. Arm one timer while closing
and reuse its remaining time after the peer Close reply. Route stack
calls through settings and remove the obsolete internal stack default
getter. Keep the legacy messageAPI overload and retain Tick only as an
ABI symbol from 2.0.0; do not schedule or emit it. Qualify the Java
getter's Scala value explicitly for cross-version compilation.

Result:
Open connections no longer receive periodic close checks; the client's
two closing phases share one budget. The default remains three seconds.

Tests:
- Changed sources compiled in Scala 2.13.18; eight settings and two
  focused client cases passed against the rebuilt classes.
- The three affected settings sources compiled on Scala 3.3.9 and 3.9.0
  against published dependencies; the unqualified getter reproduced E049.
- Targeted MiMa with the 2.0.0 artifact and rebuilt classes reproduced
  the missing Tick symbol, then reported zero problems with the fix.
- Scalafmt and git diff --check passed. The cloud JDK lacks the Java 17
  release symbols required by the unchanged aggregate build; full CI
  is not claimed locally.

References:
Refs apache#1486, netty/netty#8896 and netty/netty#9967 (independent implementation).
pjfanning pushed a commit to He-Pin/incubator-pekko-http that referenced this pull request Nov 18, 2026
Motivation:
Allow applications to tune the fixed three-second close wait without
changing the idle timeout or adding work to open connections.

Modification:
Configure the client and server close wait with Scala and Java settings
and a finite positive range up to one hour. Arm one timer while closing
and reuse its remaining time after the peer Close reply. Route stack
calls through settings and remove the obsolete internal stack default
getter. Keep the legacy messageAPI overload and retain Tick only as an
ABI symbol from 2.0.0; do not schedule or emit it. Qualify the Java
getter's Scala value explicitly for cross-version compilation.

Result:
Open connections no longer receive periodic close checks; the client's
two closing phases share one budget. The default remains three seconds.

Tests:
- Changed sources compiled in Scala 2.13.18; eight settings and two
  focused client cases passed against the rebuilt classes.
- The three affected settings sources compiled on Scala 3.3.9 and 3.9.0
  against published dependencies; the unqualified getter reproduced E049.
- Targeted MiMa with the 2.0.0 artifact and rebuilt classes reproduced
  the missing Tick symbol, then reported zero problems with the fix.
- Scalafmt and git diff --check passed. The cloud JDK lacks the Java 17
  release symbols required by the unchanged aggregate build; full CI
  is not claimed locally.

References:
Refs apache#1486, netty/netty#8896 and netty/netty#9967 (independent implementation).
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.

Merge WebSocketCloseFrameHandler into WebSocketProtocolHandler in order to minimize pipeline

3 participants