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: fuels dev cleanup not killing node #3038

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Aug 27, 2024

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@nedsalk nedsalk added the bug Issue is a bug label Aug 27, 2024
@nedsalk nedsalk self-assigned this Aug 27, 2024
Copy link

vercel bot commented Aug 27, 2024

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

Name Status Preview Comments Updated (UTC)
create-fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 11:15am
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 11:15am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 11:15am
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 11:15am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
create-fuels-counter-example ⬜️ Ignored (Inspect) Jan 3, 2025 11:15am
create-fuels-template-preview ⬜️ Ignored (Inspect) Jan 3, 2025 11:15am

@@ -233,7 +233,6 @@ export const launchNode = async ({
}
childState.isDead = true;

removeSideffects();
Copy link
Contributor Author

@nedsalk nedsalk Aug 27, 2024

Choose a reason for hiding this comment

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

Removing this line caused the issue to go away.

I suspect that the root cause of the problem is somewhere in the fuels package because this line didn't cause problems to e.g. launchTestNode. It might be in the interplay between file watchers registered in the dev command and this cleanup function removing the files they're watching, but I couldn't pinpoint the actual root cause. I tried deleting lines I think might be causing it while having this line still on, but to no avail. We can search for the root cause in another issue that's of lesser priority.

The cleanup still happens because of the error and exit event listeners registered on the child above.

@nedsalk nedsalk linked an issue Sep 14, 2024 that may be closed by this pull request
Copy link

codspeed-hq bot commented Nov 15, 2024

CodSpeed Performance Report

Merging #3038 will not alter performance

Comparing ns/fix/fuels-dev-node-cleanup (3f525ce) with master (27e8808)

Summary

✅ 18 untouched benchmarks

nedsalk and others added 2 commits November 22, 2024 13:27
…values

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
shell: bash
run: |
echo "$PWD/internal/forc/forc-binaries" >> $GITHUB_PATH
echo "$PWD/internal/fuel-core/fuel-core-binaries" >> $GITHUB_PATH
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added these to the path so that the spawn can run from the cwd of the temporary test project instead of running pnpm fuels init --path ${paths.init} from our repo's root. Both of them are using the fuels-forc under the hood, but it feels more correct to have all the commands be running from inside the temporary test folder, pnpm fuels init included.

As an alternative, I could initiate the temporary project and pass in the --fuel-core-path and --forc-path arguments to point to these binaries. I opted for adding forc and fuel-core to the path like this because this wasn't the first time I had to debug this problem only to come to the conclusion that forc and fuel-core aren't in the path.

Copy link
Contributor

github-actions bot commented Jan 3, 2025

Coverage Report:

Lines Branches Functions Statements
77.77%(-0.01%) 70.4%(+0%) 75.37%(-0.01%) 77.74%(+0%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/test-utils/launchNode.ts 95.32%
(-0.05%)
80.95%
(-1.58%)
89.47%
(+0%)
93.75%
(-0.05%)
🔴 packages/create-fuels/src/lib/getPackageManager.ts 100%
(+0%)
88.88%
(+8.88%)
100%
(+0%)
100%
(+0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exiting fuels dev with CTRL+C (SIGINT) doesn't kill fuel-core node
1 participant