Skip to content

Bazel crashes with InterruptedException when certain benign errors happen #14787

@wisechengyi

Description

@wisechengyi

Slack discussion: https://bazelbuild.slack.com/archives/CA31HN1T3/p1644524174413049

Description of the problem:

bazel error with piped

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

% bazel query tools/... | head
Loading: 0 packages loaded
//tools:bzl_srcs
//tools:embedded_tools_srcs
//tools:srcs
//tools:upload_bazel_mirror
//tools/allowlists:srcs
//tools/allowlists/config_feature_flag:srcs
//tools/allowlists/function_transition_allowlist:srcs
//tools/android:aar_embedded_jars_extractor
//tools/android:aar_embedded_jars_extractor_test
//tools/android:aar_embedded_proguard_extractor

Cannot write to standard output; exiting...

Loading: 0 packages loaded
Loading: 0 packages loaded

What operating system are you running Bazel on?

macos, but also observed similar issue on linux

$ ./bazel query tools/... | head
INFO: Invocation ID: 8fed028a-18a6-4a6c-a0b2-5a0dcfed396b
Loading: 0 packages loaded
...

Cannot write to standard output; exiting...

Loading: 0 packages loaded
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: java.lang.InterruptedException: DefaultPromise@502c56e6(incomplete)
	at io.netty.channel.pool.FixedChannelPool.close(FixedChannelPool.java:454)
	at com.google.devtools.build.lib.remote.http.HttpCacheClient.close(HttpCacheClient.java:736)
	at com.google.devtools.build.lib.remote.disk.DiskAndRemoteCacheClient.close(DiskAndRemoteCacheClient.java:71)
	at com.google.devtools.build.lib.remote.RemoteCache.deallocate(RemoteCache.java:454)
	at io.netty.util.AbstractReferenceCounted.handleRelease(AbstractReferenceCounted.java:86)
	at io.netty.util.AbstractReferenceCounted.release(AbstractReferenceCounted.java:76)
	at com.google.devtools.build.lib.remote.RemoteActionContextProvider.afterCommand(RemoteActionContextProvider.java:217)
	at com.google.devtools.build.lib.remote.RemoteModule.afterCommand(RemoteModule.java:862)
	at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:626)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:609)
	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:231)
	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:550)
	at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:614)
	at io.grpc.Context$1.run(Context.java:579)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.InterruptedException: DefaultPromise@502c56e6(incomplete)
	at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:244)
	at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:35)
	at io.netty.channel.pool.FixedChannelPool.close(FixedChannelPool.java:451)
	... 16 more

What's the output of bazel info release?

release 5.0.0

If bazel info release returns "development version" or "(@Non-Git)", tell us how you built Bazel.

Replace this line with your answer.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

% git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
https://github.com/bazelbuild/bazel
1deb3f7aa22ec322786360085f9eb723e624d7c7
1deb3f7aa22ec322786360085f9eb723e624d7c7

Have you found anything relevant by searching the web?

None yet

Other info

writing to a file works.

% bazel query tools/... > xxx && wc -l xxx
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
     282 xxx
% echo $?
0

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-Remote-ExecIssues and PRs for the Execution (Remote) teamtype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions