• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

grpc / grpc-java / #20005

01 Oct 2025 02:05AM UTC coverage: 88.585% (+0.003%) from 88.582%
#20005

push

github

web-flow
netty: Unconditionally disable adaptive cumulator (#12390)

io.netty.util.Version is unreliable, so we stop using it. grpc-netty and
grpc-netty-shaded have their version.properties mix, and you can't tell
which is which.

Changed the tests to use assume, so it is clear in the results that they
weren't run.

34859 of 39351 relevant lines covered (88.58%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.54
/../netty/src/main/java/io/grpc/netty/GrpcHttp2ConnectionHandler.java
1
/*
2
 * Copyright 2016 The gRPC Authors
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package io.grpc.netty;
18

19
import static com.google.common.base.Preconditions.checkState;
20

21
import io.grpc.Attributes;
22
import io.grpc.ChannelLogger;
23
import io.grpc.Internal;
24
import io.grpc.InternalChannelz;
25
import io.netty.channel.ChannelPromise;
26
import io.netty.handler.codec.http2.Http2ConnectionDecoder;
27
import io.netty.handler.codec.http2.Http2ConnectionEncoder;
28
import io.netty.handler.codec.http2.Http2ConnectionHandler;
29
import io.netty.handler.codec.http2.Http2Settings;
30
import javax.annotation.Nullable;
31

32
/**
33
 * gRPC wrapper for {@link Http2ConnectionHandler}.
34
 */
35
@Internal
36
public abstract class GrpcHttp2ConnectionHandler extends Http2ConnectionHandler {
37
  @Nullable
38
  protected final ChannelPromise channelUnused;
39
  private final ChannelLogger negotiationLogger;
40

41
  @SuppressWarnings("this-escape")
42
  protected GrpcHttp2ConnectionHandler(
43
      ChannelPromise channelUnused,
44
      Http2ConnectionDecoder decoder,
45
      Http2ConnectionEncoder encoder,
46
      Http2Settings initialSettings,
47
      ChannelLogger negotiationLogger) {
48
    super(decoder, encoder, initialSettings);
1✔
49
    this.channelUnused = channelUnused;
1✔
50
    this.negotiationLogger = negotiationLogger;
1✔
51
  }
1✔
52

53
  /**
54
   * Same as {@link #handleProtocolNegotiationCompleted(
55
   *   Attributes, io.grpc.InternalChannelz.Security)}
56
   * but with no {@link io.grpc.InternalChannelz.Security}.
57
   *
58
   * @deprecated Use the two argument method instead.
59
   */
60
  @Deprecated
61
  @SuppressWarnings("InlineMeSuggester") // the caller should consider providing securityInfo
62
  public void handleProtocolNegotiationCompleted(Attributes attrs) {
63
    handleProtocolNegotiationCompleted(attrs, /*securityInfo=*/ null);
×
64
  }
×
65

66
  /**
67
   * Triggered on protocol negotiation completion.
68
   *
69
   * <p>It must me called after negotiation is completed but before given handler is added to the
70
   * channel.
71
   *
72
   * @param attrs arbitrary attributes passed after protocol negotiation (eg. SSLSession).
73
   * @param securityInfo informs channelz about the security protocol.
74
   */
75
  public void handleProtocolNegotiationCompleted(
76
      Attributes attrs, InternalChannelz.Security securityInfo) {
77
  }
1✔
78

79
  /**
80
   * Returns the channel logger for the given channel context.
81
   */
82
  public ChannelLogger getNegotiationLogger() {
83
    checkState(negotiationLogger != null, "NegotiationLogger must not be null");
1✔
84
    return negotiationLogger;
1✔
85
  }
86

87
  /**
88
   * Calling this method indicates that the channel will no longer be used.  This method is roughly
89
   * the same as calling {@link #close} on the channel, but leaving the channel alive.  This is
90
   * useful if the channel will soon be deregistered from the executor and used in a non-Netty
91
   * context.
92
   */
93
  @SuppressWarnings("FutureReturnValueIgnored")
94
  public void notifyUnused() {
95
    channelUnused.setSuccess(null);
×
96
  }
×
97

98
  /** Get the attributes of the EquivalentAddressGroup used to create this transport. */
99
  public Attributes getEagAttributes() {
100
    return Attributes.EMPTY;
1✔
101
  }
102

103
  /**
104
   * Returns the authority of the server. Only available on the client-side.
105
   *
106
   * @throws UnsupportedOperationException if on server-side
107
   */
108
  public String getAuthority() {
109
    throw new UnsupportedOperationException();
×
110
  }
111
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc