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

Port busy: process fails to close properly #94

Open
SebastienGllmt opened this issue Dec 30, 2024 · 1 comment · Fixed by #96
Open

Port busy: process fails to close properly #94

SebastienGllmt opened this issue Dec 30, 2024 · 1 comment · Fixed by #96
Assignees

Comments

@SebastienGllmt
Copy link
Contributor

When sending a shutdown signal to yaci-devkit (via npm), the process is not shut down properly leaving services running on port 10000 and 8090

I have to kill these manually every time, which is really annoying for debugging. I would prefer properly cleaning up over any patch like #10 because dynamic ports are also harder to compose with other tools

The exact error you see when this error happens is either

Submit Api Port 8090 is not available. Please check if the port is already in use.

or

ERROR org.apache.catalina.util.LifecycleBase   - Called stop() on failed component [StandardService[Tomcat]] to trigger clean-up but it failed too
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_stop]) for component [StandardEngine[Tomcat]] in state [INITIALIZED]
@satran004 satran004 self-assigned this Jan 2, 2025
satran004 added a commit that referenced this issue Jan 3, 2025
* #94 Create pid files for each process and perform cleanup during CLI startup

* #94 If yaci-cli.pid exists, kill the process and then invoke yaci-cli

* Bump version
@satran004
Copy link
Member

@SebastienGllmt

This is available in 0.10.0-preview5 release.

Yaci CLI now creates PID files for all sub-processe such as Node, Submit API, Ogmios, and Yaci-Store during startup. These files are removed when the CLI stops cleanly.

During the up command, Yaci CLI checks for any existing PID files and attempts to kill those processes before starting the node and other components.

Similarly, a PID file is created when Yaci CLI starts via start.js in the npm distribution, which handles cleanup before beginning a new session of Yaci CLI. This works in most scenarios, though there may still be a few edge cases we need to identify and fix.
Note that this applies only to the Yaci CLI process, as it’s started as a subprocess from a JS file.

All other subprocesses (like node, etc.) are managed directly by Yaci CLI and are now terminated properly.

@satran004 satran004 reopened this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants