Commit cc29f8f
[server][fc] Fix gRPC read stats recording successful reads as failures
GrpcOutboundStatsHandler chose between successRequest and errorRequest with:
!ctx.hasError() && !responseStatus.equals(OK) ||
responseStatus.equals(NOT_FOUND)
Java evaluates && before ||, so this parses as
(!hasError && !status.equals(OK)) || status.equals(NOT_FOUND). A successful
value-found read (no error, status OK) evaluates to false and falls into the
else branch, recording the read via errorRequest(). That emits
Read.CallCount{Http.Response.StatusCode=200,
Venice.Response.StatusCodeCategory=fail}
and increments the error_request sensor for every successful gRPC read. The
same
broken condition also recorded genuine 400/500 errors and 429 throttles as
successes.
Parenthesize the condition to mirror the Netty StatsHandler: record a success
only when no handler flagged an error and the status is OK or NOT_FOUND;
record
TOO_MANY_REQUESTS as neither (a throttled request is not a server-side
failure);
record everything else as an error.
Added GrpcOutboundStatsHandlerTest covering value-found -> success (regression
guard), key-absent -> success, error-flagged-with-OK -> error, 400/500 ->
error,
and 429 -> neither.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2ad367e commit cc29f8f
2 files changed
Lines changed: 85 additions & 3 deletions
File tree
- services/venice-server/src
- main/java/com/linkedin/venice/listener/grpc/handlers
- test/java/com/linkedin/venice/listener/grpc/handlers
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
Lines changed: 77 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments