Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Server][6.3.2] Improve ALREADY_EXISTS status handling #1452

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jerrymarino
Copy link
Contributor

@jerrymarino jerrymarino commented Sep 22, 2023

Sending an ALREADY_EXISTS for duplicated writes. Sometimes we may have this value after the client makes a find missing blobs request. In 6.4.0rc1 there were a few improvements to this by the way. It seems like this is a better treatment of it regardless

This also fixes an issue with some serious log spam.

Sending an ALREADY_EXISTS for duplicated writes. Sometimes we may have
this value after the client makes a find missing blobs request

This also fixes an issue with some serious log spam
@jerrymarino
Copy link
Contributor Author

I was having a trace like this:

build.buildfarm.common.Write$WriteCompleteException
at build.buildfarm.common.grpc.StubWriteOutputStream.write(StubWriteOutputStream.java:248)
at java.base/java.io.OutputStream.write(OutputStream.java:124)
at com.google.protobuf.ByteString$LiteralByteString.writeTo(ByteString.java:1381)
at build.buildfarm.common.services.WriteStreamObserver.writeData(WriteStreamObserver.java:420)
at build.buildfarm.common.services.WriteStreamObserver.handleWrite(WriteStreamObserver.java:392)
at build.buildfarm.common.services.WriteStreamObserver.handleRequest(WriteStreamObserver.java:307)
at build.buildfarm.common.services.WriteStreamObserver.initialize(WriteStreamObserver.java:250)
at build.buildfarm.common.services.WriteStreamObserver.onUncommittedNext(WriteStreamObserver.java:128)
at build.buildfarm.common.services.WriteStreamObserver.onNext(WriteStreamObserver.java:107)
at build.buildfarm.common.services.WriteStreamObserver.onNext(WriteStreamObserver.java:56)
at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:262)
at io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
at io.grpc.util.TransmitStatusRuntimeExceptionInterceptor$1.onMessage(TransmitStatusRuntimeExceptionInterceptor.java:65)
at io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
at io.grpc.Contexts$ContextualizedServerCallListener.onMessage(Contexts.java:76)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailableInternal(ServerCallImpl.java:333)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:316)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:835)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1589)

Comment on lines 411 to 412
log.log(Level.FINE, format("already wrote data for %s", name), e);
errorResponse(status.asException());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditional this fine logging with if (errorResponse... to be complete - errorResponse returns false if we've already delivered a response to the stream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM - I've wrapped it in this conditional 👍

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.

2 participants