Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are sometimes situations where the client will retry, and we have already serialzed part of the invocation to the database, but failed to serialize the whole thing, which causes issues. (Example logs below)
This PR implements a transaction wrapper in an attempt to address this. if we hit an error, we bail out of saving the invocation.
portal-9785fd988-gn9d7 backend 2024/11/04 13:43:00 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:00.023Z\",\n \"invocationAttemptFinished\": {\n \"invocationStatus\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:00 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:00.058Z\",\n \"buildFinished\": {\n \"status\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:26.519Z\",\n \"buildEnqueued\": {}\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:26.536Z\",\n \"invocationAttemptStarted\": {\n \"attemptNumber\": \"1\"\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Stream started event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Stream finished event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Saving invocation InvocationId=6657b2dc-a8fa-440f-8321-4b38393e71df BuildId=9a95e4a7-ee65-4fc7-a8a5-a518157afde0 Component=TOOL portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Saved invocation in 4.669009ms id=6657b2dc-a8fa-440f-8321-4b38393e71df portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:26.801Z\",\n \"invocationAttemptFinished\": {\n \"invocationStatus\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:26 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:26.838Z\",\n \"buildFinished\": {\n \"status\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:54.270Z\",\n \"buildEnqueued\": {}\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:54.282Z\",\n \"invocationAttemptStarted\": {\n \"attemptNumber\": \"1\"\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Stream started event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Stream finished event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Saving invocation InvocationId=777e5ebc-cf12-471f-b350-8a3269136919 BuildId=2977f0e8-08c0-40c4-9dce-d0e170f2ceda Component=TOOL portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Saved invocation in 8.13817ms id=777e5ebc-cf12-471f-b350-8a3269136919 portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:54.671Z\",\n \"invocationAttemptFinished\": {\n \"invocationStatus\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:54 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:54.705Z\",\n \"buildFinished\": {\n \"status\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:57.981Z\",\n \"buildEnqueued\": {}\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:57.990Z\",\n \"invocationAttemptStarted\": {\n \"attemptNumber\": \"1\"\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Stream started event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Stream finished event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Saving invocation InvocationId=a3587ea0-ffb1-4ee2-8cf3-7d84e566a6e9 BuildId=5fd59cbf-0a54-4505-85db-0a9d36681fe0 Component=TOOL portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Saved invocation in 4.89804ms id=a3587ea0-ffb1-4ee2-8cf3-7d84e566a6e9 portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:58.242Z\",\n \"invocationAttemptFinished\": {\n \"invocationStatus\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:43:58 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:43:58.275Z\",\n \"buildFinished\": {\n \"status\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:44:13.488Z\",\n \"buildEnqueued\": {}\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:44:13.499Z\",\n \"invocationAttemptStarted\": {\n \"attemptNumber\": \"1\"\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Stream started event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Stream finished event="context.Background.WithValue(transport.connectionKey, *net.TCPConn).WithValue(peer.peerKey, Peer{Addr: '10.132.0.92:39213', LocalAddr: '10.24.27.72:8082', AuthInfo: 'tls'}).WithCancel.WithValue(metadata.mdIncomingKey, metadata.MD).WithValue(grpc.serverKey, *grpc.Server).WithValue(grpc.streamKey, *transport.Stream).WithValue(grpc.rpcInfoContextKey, *grpc.rpcInfo).WithValue(b3.b3KeyType, bool).WithValue(b3.b3KeyType, bool).WithValue(trace.traceContextKeyType, trace.nonRecordingSpan).WithValue(trace.traceContextKeyType, *trace.recordingSpan).WithValue(trace.traceContextKeyType, *otel.activeSpan).WithValue(auth.authenticationMetadataKey, *auth.AuthenticationMetadata)" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Saving invocation InvocationId=d8787608-d2b0-4c8e-925f-302797ba0ecd BuildId=f46addc6-71e2-449f-af1d-9d9ef6b7b7fb Component=TOOL portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Saved invocation in 15.73136ms id=d8787608-d2b0-4c8e-925f-302797ba0ecd portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:44:13.771Z\",\n \"invocationAttemptFinished\": {\n \"invocationStatus\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:13 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:44:13.805Z\",\n \"buildFinished\": {\n \"status\": {\n \"result\": \"COMMAND_SUCCEEDED\"\n }\n }\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:52 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:44:52.615Z\",\n \"buildEnqueued\": {}\n}" portal-9785fd988-gn9d7 backend 2024/11/04 13:44:52 INFO Received event event="{\n \"eventTime\": \"2024-11-04T13:44:52.626Z\",\n \"invocationAttemptStarted\": {\n \"attemptNumber\": \"1\"\n }\n}" portal-9785fd9...