8000 [aquery] only flush the relevant output channel. · coderabbit-test/bazel@6504a25 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6504a25

Browse files
joelebacopybara-github
authored andcommitted
[aquery] only flush the relevant output channel.
Depending on the output type. PiperOrigin-RevId: 554730946 Change-Id: I62c2fbc62dcf1e9022cc0cccad9d1bd244bea982
1 parent 9d30849 commit 6504a25

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/main/java/com/google/devtools/build/lib/skyframe/actiongraph/v2/StreamedConsumingOutputHandler.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,19 @@ void addTaskToQueue(Message message, int fieldNumber, String messageLabel) {
158158

159159
@Override
160160
public void close() throws IOException {
161-
outputStream.flush();
162-
codedOutputStream.flush();
163-
printStream.flush();
161+
switch (outputType) {
162+
case BINARY:
163+
codedOutputStream.flush();
164+
break;
165+
case DELIMITED_BINARY:
166+
outputStream.flush();
167+
break;
168+
case TEXT:
169+
printStream.flush();
170+
break;
171+
default:
172+
throw new IllegalStateException("Unknown outputType: " + outputType);
173+
}
164174
}
165175

166176
// Only runs on 1 single thread.

0 commit comments

Comments
 (0)
0