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

fix(core): do not check open connections during inactivity #29621

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Jan 14, 2025

Current Behavior

We currently second guess our inactivity timer by checking if there are any open connections. However, there's also a strong chance that plugin workers will remain open as long as the daemon is open. This means the daemon stays alive forever and the daemon never shuts down even though it is inactive.

Expected Behavior

Instead of checking for open connections in general, the daemon server will only check for open file watchers. Most Daemon client requests will restart the server when sending messages so we can safely shut the server down in most cases. The only case where shutting down the daemon would cause a disruption is if a file watcher is registered. In those cases, the daemon will not shutdown due to inactivity.

Related Issue(s)

Fixes #

@FrozenPandaz FrozenPandaz requested a review from a team as a code owner January 14, 2025 20:27
Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 14, 2025 10:08pm

Copy link

nx-cloud bot commented Jan 14, 2025

View your CI Pipeline Execution ↗ for commit e748bd9.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 34m 37s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 15s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=61815... ✅ Succeeded 23s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 22s View ↗
nx documentation --no-dte ✅ Succeeded 1m 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-14 22:46:43 UTC

@FrozenPandaz FrozenPandaz force-pushed the inactivity branch 2 times, most recently from beb3d05 to a2233d5 Compare January 14, 2025 22:04

Verified

This commit was signed with the committer’s verified signature.
ssbarnea Sorin Sbarnea
@FrozenPandaz FrozenPandaz merged commit 32a2ca8 into master Jan 15, 2025
6 checks passed
@FrozenPandaz FrozenPandaz deleted the inactivity branch January 15, 2025 15:43
FrozenPandaz added a commit that referenced this pull request Jan 15, 2025

Verified

This commit was signed with the committer’s verified signature.
ssbarnea Sorin Sbarnea
…own (#29621)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

We currently second guess our inactivity timer by checking if there are
any open connections. However, there's also a strong chance that plugin
workers will remain open as long as the daemon is open. This means the
daemon stays alive forever and the daemon never shuts down even though
it is inactive.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Instead of checking for open connections in general, the daemon server
will only check for open file watchers. Most Daemon client requests will
restart the server when sending messages so we can safely shut the
server down in most cases. The only case where shutting down the daemon
would cause a disruption is if a file watcher is registered. In those
cases, the daemon will not shutdown due to inactivity.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

(cherry picked from commit 32a2ca8)
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2025
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.

None yet

3 participants