MCPcopy Create free account
hub / github.com/grpc/grpc-java / validateGeneration

Method validateGeneration

api/src/context/java/io/grpc/Context.java:1108–1117  ·  view source on GitHub ↗

If the ancestry chain length is unreasonably long, then print an error to the log and record the stack trace.

(int generation)

Source from the content-addressed store, hash-verified

1106 * the stack trace.
1107 */
1108 private static void validateGeneration(int generation) {
1109 if (generation == CONTEXT_DEPTH_WARN_THRESH) {
1110 log.log(
1111 Level.SEVERE,
1112 "Context ancestry chain length is abnormally long. "
1113 + "This suggests an error in application code. "
1114 + "Length exceeded: " + CONTEXT_DEPTH_WARN_THRESH,
1115 new Exception());
1116 }
1117 }
1118
1119 // Not using the standard com.google.errorprone.annotations.CheckReturnValue because that will
1120 // introduce dependencies that some io.grpc.Context API consumers may not want.

Callers 1

ContextMethod · 0.95

Calls 1

logMethod · 0.45

Tested by

no test coverage detected