Skip to content
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

ftl dev --no-serve --stop goes into a connection loop if the server isn't running #1167

Closed
alecthomas opened this issue Apr 4, 2024 · 4 comments · Fixed by #1325
Closed
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@alecthomas
Copy link
Collaborator

alecthomas commented Apr 4, 2024

If the server isn't running it should immediately terminate, possibly with an error.

🐚 ~/dev/ftl $ ftl dev --log-level=trace --no-serve --stop
trace: Loading config from /Users/alec/dev/ftl/ftl-project.toml
trace: /xyz.block.ftl.v1.ControllerService/Status (unary)
trace:localhost: Trying authenticator
trace:localhost: No authenticator found for http://localhost:8892/xyz.block.ftl.v1.ControllerService/Status in map[ftl.tbddev.org:ftl-authenticator-tbddev]
debug: Unary RPC failed: unavailable: dial tcp [::1]:8892: connect: connection refused: /xyz.block.ftl.v1.ControllerService/Status
trace: Error getting status, retrying...: unavailable: dial tcp [::1]:8892: connect: connection refused
trace: /xyz.block.ftl.v1.ControllerService/Status (unary)
debug: Unary RPC failed: unavailable: dial tcp [::1]:8892: connect: connection refused: /xyz.block.ftl.v1.ControllerService/Status
trace: Error getting status, retrying...: unavailable: dial tcp [::1]:8892: connect: connection refused
trace: /xyz.block.ftl.v1.ControllerService/Status (unary)
debug: Unary RPC failed: unavailable: dial tcp [::1]:8892: connect: connection refused: /xyz.block.ftl.v1.ControllerService/Status
trace: Error getting status, retrying...: unavailable: dial tcp [::1]:8892: connect: connection refused
...
@alecthomas alecthomas added the bug Something isn't working label Apr 4, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Apr 4, 2024
@alecthomas alecthomas mentioned this issue Apr 4, 2024
@wesbillman wesbillman added the good first issue Good for newcomers label Apr 5, 2024
@alecthomas alecthomas added next Work that will be be picked up next and removed triage Issue needs triaging labels Apr 8, 2024
@deniseli deniseli self-assigned this Apr 17, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Apr 17, 2024
@deniseli
Copy link
Contributor

@alecthomas what was the use case for using --stop and --no-serve together? The current PR I have just kills the background serve and returns immediately to prevent the wait loop, but I wasn't sure if you had a more proper use case in mind here. Thanks!

@alecthomas
Copy link
Collaborator Author

That's exactly what I was trying to achieve yeah.

deniseli added a commit that referenced this issue Apr 24, 2024
…erve) are used (#1325)

Fixes #1167

Manually tested:

```
$ ftl dev --stop --no-serve ./examples/go --log-level=trace
trace: Loading config from /Users/dli/Development/ftl/ftl-project.toml
debug: FTL serve is not running in the background
$ ftl serve --background
info: `ftl serve` running in background with pid: 42320
$ ftl dev --stop --no-serve ./examples/go --log-level=trace
trace: Loading config from /Users/dli/Development/ftl/ftl-project.toml
info: `ftl serve` stopped (pid: 42320)
```
@alecthomas
Copy link
Collaborator Author

The flags are a touch confusing to me. I think I would expect --stop to terminate the background process, then exit...but then it would be also useful to be able to stop and serve simultaneously, so I'm not sure.

@deniseli
Copy link
Contributor

Agree it's confusing. I needed some help to make sure I was understanding it correctly. It looks like right now, if --no-serve is absent but --stop is present, it does restart it, which is nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants