-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Worker Spawn Runner throws "Worker process did not return a WorkResponse" with empty error message #11948
Comments
This is super helpful for debugging, thanks @ThomasCJY |
… issue **Background** https://jira.sc-corp.net/browse/APP-60122 More details see upstream ticket: bazelbuild#11948 This issue is a regression from Bazel 3.1.0+. This PR is a temp work around. --- Automatic squash commit from https://github.sc-corp.net/Snapchat/bazel/pull/63 Cooled by jchen
I can see two steps towards fixing this.
Would fix no. 1 by itself - which is quite simple - be sufficient for you? |
cc @susinmotion |
@tetromino yeah fixing no.1 will be sufficient in the current stage. Thanks! |
In certain circumstances the various android compilation tools could output to stdout while operating as a persistent worker which would lead to a corruption of the response protobuf and ultimately lead to a failed build. This PR solves that problem by redirecting all stdout and stderr emitted by the worker to an in-memory buffer that is later attached to the proto response as an output. In this way, all future tools added to the tool wrapper can benefit from having their output logged rather than cause a build failure. #10527 #9207 Closes #10911. PiperOrigin-RevId: 307252644
https://stackoverflow.com/questions/3340342/writing-to-the-real-stdout-after-system-setout talks about how to properly redirect stdout, it looks like what the current code does is incorrect. I like the idea of redirecting stdout, though, and will add it to WorkRequestHandler. |
… issue **Background** https://jira.sc-corp.net/browse/APP-60122 More details see upstream ticket: bazelbuild#11948 This issue is a regression from Bazel 3.1.0+. This PR is a temp work around. --- Automatic squash commit from https://github.sc-corp.net/Snapchat/bazel/pull/63 Cooled by jchen
I can't seem to repro this in Bazel |
We still see this issue with Bazel 5.1.1. The issue goes away when not using a persistent worker. I can give more info if needed. |
Background
This is a follow-up for #11691. Previously, after enabling spawn worker for android resource merging actions, the error logs cannot be correctly displayed in console so I made this change to fix this issue. However, a recent update which is included in the 3.1.0+ bazel releases introduced another regression where all the std output and std err has been hijacked for spawn workers and worker response will always be null. This can be reproduced on this test branch:
Test branch (link)
Repro steps
bazelisk build //src/test:main_activity_test
check the output.build --config=android_workers
from.bazelrc
, retry step 1. Check the correct error message.The output for step 1 looks like this, where both stdout and stderr are empty.
The output for step 2 will have stdout. We can apply #11691 to show the error log.
Ideally, after applying #11691 and fixed the regression, we would get:
The text was updated successfully, but these errors were encountered: