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

Restart AppMap process when it terminates unexpectedly #497

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

jansorg
Copy link
Collaborator

@jansorg jansorg commented Nov 15, 2023

Closes #411

This PR implements restart of AppMap CLI processes.
Initially, when processes are launched for an AppMap-enabled directory, both indexer and scanner processes are started.
Now, when one of the processes terminates unexpectedly, this process is restarted after a delay. The initial delay is 5s, the next next 5s*1.5=7.25s and the next 7.25s*1.5=10.9s and after the third unexpected termination no further restart is attempted.

This PR adds a tests to verify the restart.

Copy link

github-actions bot commented Nov 15, 2023

AppMap runtime code review

Summary Status
Failed tests ✅ All tests passed
API changes 0️⃣ No API changes
Security flaws ✅ None detected
Performance problems ✅ None detected
Code anti-patterns ✅ None detected
New AppMaps ⭐ 2 new junit tests

⭐ New AppMaps

[junit] Default command line service indexer process restart from plugin-core/src/test/java/appland/cli/DefaultCommandLineServiceTest.java:191

[junit] Default command line service scanner process restart from plugin-core/src/test/java/appland/cli/DefaultCommandLineServiceTest.java:200

@jansorg jansorg marked this pull request as draft November 15, 2023 14:36
@jansorg jansorg force-pushed the jansorg/cli-termination-handling branch from 37c29f8 to 67fa2dc Compare November 22, 2023 11:24
@jansorg jansorg changed the title Shutdown all CLI processes when one of them terminated Restart AppMap process when it terminates unexpectedly Nov 22, 2023
@jansorg jansorg force-pushed the jansorg/cli-termination-handling branch 2 times, most recently from 94c7727 to cd52710 Compare November 22, 2023 11:45
@jansorg jansorg marked this pull request as ready for review November 22, 2023 11:45
@jansorg jansorg force-pushed the jansorg/cli-termination-handling branch 3 times, most recently from 81592ad to e467b10 Compare November 29, 2023 10:15
@jansorg jansorg force-pushed the jansorg/cli-termination-handling branch from e467b10 to b44510a Compare November 29, 2023 10:21
@jansorg jansorg requested a review from ahtrotta November 29, 2023 10:31
Copy link
Contributor

@ahtrotta ahtrotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked well when I gave it a spin and looks good, thanks!

@jansorg jansorg merged commit ab91c81 into develop Dec 1, 2023
6 checks passed
@jansorg jansorg deleted the jansorg/cli-termination-handling branch December 1, 2023 13:26
@appland-release
Copy link
Contributor

🎉 This PR is included in version 0.54.0 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppMap CLI process could be terminated in a better way
3 participants