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 5 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 Nov 22, 2024 1:43pm
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 1:43pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 1:43pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 1:43pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
create-fuels-counter-example ⬜️ Ignored (Inspect) Nov 22, 2024 1:43pm
create-fuels-template-preview ⬜️ Ignored (Inspect) Nov 22, 2024 1:43pm

@@ -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

✅ Your fuels version is up to date: 0.97.0

Config file not found! cleanup not killing node
@nedsalk nedsalk force-pushed the ns/fix/fuels-dev-node-cleanup branch from c5aab56 to c187c5e Compare November 22, 2024 12:13
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

Coverage Report:

Lines Branches Functions Statements
64.12%(+0%) 69.66%(+0%) 72.66%(+0%) 64.56%(+0%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
78.08%
(+1.37%)
84%
(+0%)
88.81%
(+0%)
🔴 packages/account/src/test-utils/launchNode.ts 97.02%
(-0.03%)
85.96%
(-1.75%)
100%
(+0%)
97.16%
(-0.03%)

@nedsalk nedsalk marked this pull request as ready for review November 22, 2024 14:19
@nedsalk nedsalk marked this pull request as draft November 25, 2024 07:11
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