-
-
Notifications
You must be signed in to change notification settings - Fork 5
Improve shutdown for FwLiteWeb in Paratext #1992
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
base: develop
Are you sure you want to change the base?
Conversation
* Replace direct process killing with a dedicated `shutdownFwLite` function for graceful termination. * Update FwLiteWeb to properly handle `shutdown` commands via stdin. * Adjust process stdio configuration for consistency.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughAdds a console-driven shutdown path: the web app listens for "shutdown" on stdin and stops asynchronously. The extension adjusts process launch to enable stdin and introduces a helper to send "shutdown\n", await clean exit, and force-kill after 10 seconds if needed. Cleanup now uses the graceful shutdown helper. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
backend/FwLite/FwLiteWeb/Program.cs (1)
18-25: Optional: guard against unexpected read errors and log.Wrap the loop in try/catch so unexpected I/O failures don’t tear down the background task silently. If you have logging on the host, log and call StopAsync().
platform.bible-extension/src/main.ts (1)
296-315: Optional: kill the process tree on Windows if FwLiteWeb spawns children.If FwLiteWeb ever spawns child processes, consider terminating the whole tree (e.g., taskkill /T /F or a library like tree-kill) in the fallback, otherwise stdout/stderr handles may keep the parent alive.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
backend/FwLite/FwLiteWeb/Program.cs(1 hunks)platform.bible-extension/src/main.ts(3 hunks)
🧰 Additional context used
🪛 GitHub Actions: Platform.Bible extension CI/CD
platform.bible-extension/src/main.ts
[warning] 1-1: Code style issues found in 'src/main.ts'. Run 'prettier --write .' to fix.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: frontend
- GitHub Check: frontend-component-unit-tests
- GitHub Check: Build FW Lite and run tests
- GitHub Check: Analyze (csharp)
🔇 Additional comments (3)
platform.bible-extension/src/main.ts (3)
252-252: Good: register graceful cleanup instead of hard kill.Hooking cleanup to a shutdown function is the right direction. Verify the activation host treats a rejected Promise from a disposer as a non-fatal deactivation; otherwise prefer resolving false instead of rejecting.
279-279: Stdin pipe is required here—LGTM.Switching stdio to ['pipe','pipe','pipe'] is necessary so the backend can read the shutdown command.
1-1: Run Prettier via the package’s format script
CI flagged formatting in platform.bible-extension/src/main.ts; execute in that folder:cd platform.bible-extension && pnpm run formatLikely an incorrect or invalid review comment.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
myieye
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🙃 😬
|
@copilot Please review and implement as appropriate the open suggestions from coderabbitai. So: |
|
@imnasnainaec I've implemented the AI feedback. Would you be willing to take another look and maybe actually run it? |
imnasnainaec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting on paranext/paranext-core#1936 (or something equivalent).
It turns out that windows doesn't have a gracefull shutdown of a process outside of Ctrl+C which you can't just send to a process you've spawned. Hence this fix.
shutdownFwLitefunction for graceful termination, replacing direct process killing.shutdowncommands via stdin.