aspect-build / aspect-build/rules_js
Persistent workers with js_run_binary
- Dominant language
- Starlark
- Stars
- 378
- Forks
- 183
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 29
Description
Apologies for the lack of detail here but is it expected that passing `execution_requirements = {"supports-workers": "1"}` to create a persistent worker from a `js_run_binary` would work?
I'm attempted to migrate a persistent worker created from a `nodejs_binary` and a custom rule to `js_binary` and `js_run_binary` but have noticed that the worker simply hangs indefinitely. The outputs are being produced and the build succeeds if it crashes (such as throwing an error on a timeout).
Running the worker in standalone mode produces a proper output without any changes to the tool and the worker works under the old setup.
The worker uses `@bazel/worker` to interface with the bazel worker protocol. I'm not sure if this is something the team has attempted or not or even expects to work. Do you know of any examples of a working persistent worker run with `js_run_binary`?
Contributor guide
Research direction
Start by reproducing the persistent-worker setup using js_run_binary with execution_requirements set to supports-workers: 1, then compare it with the working nodejs_binary setup and standalone mode. Use the @bazel/worker interface and the reported hang, produced outputs, and crash-on-timeout behavior to determine whether the worker completes requests; done means the js_run_binary worker produces the expected output without hanging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100