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

Process recording doesn't complete #118

Closed
kgilpin opened this issue Feb 27, 2024 · 4 comments · Fixed by #141
Closed

Process recording doesn't complete #118

kgilpin opened this issue Feb 27, 2024 · 4 comments · Fixed by #141
Assignees
Labels
bug Something isn't working released

Comments

@kgilpin
Copy link
Contributor

kgilpin commented Feb 27, 2024

Running AppMap index service:

npx appmap-node env APPLAND_API_KEY=<key> node ./built/cli.js index -d ~/source/appland/appland -v -w -p 30101 

When the process is terminated via Ctrl-C, the part file is left behind and not completed as an appmap.json.

Branch you can use: getappmap/appmap-js#1603

You can trigger a request to the service like this:

node ./bin/rpcClient explain '{"question":"Add a captcha to the user login" }'

Or

./bin/rpcClient search '{"query":"maxresults up-to-date parameters settings config maximumresults limit current updated latest","maxResults":10}'

Use your imagination :-)

@kgilpin kgilpin added the bug Something isn't working label Feb 27, 2024
@dividedmind
Copy link
Collaborator

Note this can be reproduced on main branch of appmap-js:

$ appmap-node built/cli.js index -w -d /some/project  # works
$ appmap-node node built/cli.js index -w -d /some/project  # breaks

@zermelo-wisen zermelo-wisen self-assigned this Apr 8, 2024
zermelo-wisen added a commit that referenced this issue Apr 11, 2024
This fixes a bug (#118) which occured when there is a script
with active setInterval call and appmap-node runs this script
indirectly with a node process: npx appmap-node node interval.js.
@zermelo-wisen
Copy link
Contributor

I found that this bug occurs when there is a script with active setInterval call and appmap-node runs this script indirectly with a node process: appmap-node node interval.js.

Changing the way we forward signals (SIGINT resulting from Ctrl-C) to the child process seemed to solve the issue. I put a test that tests exactly this behavior and it fails without the fix.

Beside this, I tested the fix with the case reported by @dividedmind above: appmap-node node built/cli.js index -w -d /some/project # breaks, assuming it's similar to the original command above which needs an APPLAND_API_KEY.

zermelo-wisen added a commit that referenced this issue Apr 14, 2024
This fixes a bug (#118) which occured when there is a script
with active setInterval call and appmap-node runs this script
indirectly with a node process: npx appmap-node node interval.js.
zermelo-wisen added a commit that referenced this issue Apr 25, 2024
This fixes a bug (#118) which occured when there is a script
with active setInterval call and appmap-node runs this script
indirectly with a node process: npx appmap-node node interval.js.
@kgilpin
Copy link
Contributor Author

kgilpin commented Jul 22, 2024

This seems to be resolved now.

@kgilpin kgilpin closed this as completed Jul 22, 2024
dustinbyrne pushed a commit that referenced this issue Jul 29, 2024
This fixes a bug (#118) which occured when there is a script
with active setInterval call and appmap-node runs this script
indirectly with a node process: npx appmap-node node interval.js.
appland-release pushed a commit that referenced this issue Jul 29, 2024
## [2.23.2](v2.23.1...v2.23.2) (2024-07-29)

### Bug Fixes

* Handle parent Ctrl-C in child process with setInterval ([e7f82f4](e7f82f4)), closes [#118](#118)
@appland-release
Copy link

🎉 This issue has been resolved in version 2.23.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants