Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Comments

feat(deno-runtime): restart app process if it times out consecutively#777

Merged
d-gubert merged 4 commits intoalphafrom
deno/better-ping
Jul 9, 2024
Merged

feat(deno-runtime): restart app process if it times out consecutively#777
d-gubert merged 4 commits intoalphafrom
deno/better-ping

Conversation

@d-gubert
Copy link
Member

@d-gubert d-gubert commented Jul 1, 2024

What? ⛵

Extracted two new components from the DenoRuntimeSubprocessController class:

  • ProcessMessenger - controls transport of messages to the subprocess
  • LivenessManager - controls the ping processes and restarts

Refactor the ping functionality to add the following:

  • Keep track of consecutive ping timeouts. If reaches limit (currently 4), tries to restart the subprocess
  • Keep track of restarts. If reaches limit (currently 3), stops restarting and leaves app in "broken" state
  • Pings will now be aborted if the process exits (either due to a Deno error or a kill)
  • Pings will now only start after the process is ready.

Why? 🤔

If the Deno subprocess goes to an invalid state and stop responding, we try to restart it in hopes that this recovers the process nicely.

Links 🌎

PS 👀

@d-gubert d-gubert force-pushed the deno/better-ping branch from 2236d0e to ae18e4f Compare July 1, 2024 22:56
@d-gubert d-gubert marked this pull request as ready for review July 5, 2024 20:13
@d-gubert d-gubert assigned d-gubert and unassigned d-gubert Jul 5, 2024
@d-gubert d-gubert requested a review from tapiarafael July 5, 2024 20:46
@d-gubert d-gubert force-pushed the deno/better-ping branch from 79aa16e to 9899646 Compare July 8, 2024 16:46
tapiarafael
tapiarafael previously approved these changes Jul 8, 2024
@d-gubert d-gubert marked this pull request as draft July 8, 2024 20:53
@d-gubert d-gubert marked this pull request as ready for review July 9, 2024 02:49
@d-gubert d-gubert merged commit 02d8fec into alpha Jul 9, 2024
@d-gubert d-gubert deleted the deno/better-ping branch July 9, 2024 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants