luckyframework / luckyframework/lucky_cli

Nox process manager fails to keep certain processes running

Open
#752 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
92
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I'm pretty sure this must relate to exit codes and how yarn wraps different types of ongoing watch processes + how Nox traps exit codes, but haven't dug in deeply yet.

https://github.com/robcole/lucky_nox_bug has a repo that can repro this (this is just a one-off creation from @grepsedawk's https://github.com/grepsedawk/horseshoe template starter).

Steps to replicate:

1 - Clone the repo.
2 - Run script/setup.
3 - Run `lucky dev`

You'll note the following in the logs:

```
js_assets | Done in 0.30s.
js_assets | Done
css_assets | Done in 0.54s.
css_assets | Done
```

That alone isn't problematic, but any save events won't trigger a recompilation, as Nox seems to think the process has exited completely:

```
web | [Browsersync] Proxying: http://127.0.0.1:3000
web | [Browsersync] Access URLs:
web | ----------------------------
web | Local: http://localhost:3001
web | ----------------------------
web | [Browsersync] Watching files...

... file save in app.ts happens here ...

... nothing ...

... I exit with ^C ...

^Csystem_check | Attempting to interrupt...
web | Attempting to interrupt...
docker | Attempting to interrupt...
docker | Gracefully stopping... (press Ctrl+C again to force)
system_check | Done
docker | time="2022-04-24T08:22:25-07:00" level=error msg="got 3 SIGTERM/SIGINTs, forcing shutdown"
```

Compare this to overmind, and you'll note that overmind will continue to properly pick up on filesystem events and recompilation will be triggered in Lucky:

```
web | [Browsersync] Proxying: http://127.0.0.1:3000
web | [Browsersync] Access URLs:
web | ----------------------------
web | Local: http://localhost:3001
web | ----------------------------
web | [Browsersync] Watching files...

... file save in app.ts happens here ...

js_assets | [watch] build started (change: "src/js/app.ts")
js_assets | [watch] build finished
web | [Browsersync] Reloading Browsers...

... I exit with ^C ...

^Cjs_assets | Interrupting...
css_assets | Interrupting...
docker | Interrupting...
system_check | Interrupting...
web | Interrupting...
docker | Gracefully stopping... (press Ctrl+C again to force)
web | Exited
css_assets | Exited
system_check | Exited
js_assets | Exited
[+] Running 1/1
docker | ⠿ Container lucky_nox_bug-postgres-1 Stopped 0.1s
docker | canceled
docker | Exited
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the linked lucky_nox_bug reproduction, run script/setup, then run `lucky dev` and inspect how the Nox-managed processes report completion and handle exit codes. Compare the behavior with overmind while saving app.ts. Done means watch processes remain active, filesystem changes trigger recompilation, and shutdown still completes cleanly.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal, docker
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.