-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add force parameter to close method for immediate shutdown #314
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: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto 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 Comment |
Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #314 +/- ##
=======================================
Coverage 91.97% 91.97%
=======================================
Files 97 97
Lines 3728 3728
Branches 1904 1904
=======================================
Hits 3429 3429
Misses 299 299 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| void main() { | ||
| group('Given a RelicServer with force close', () { |
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.
This is a bad group title. There is already 'Given a RelicServer with in-flight requests' group use that instead.
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.
Fixed in f8f45c7. Moved force close tests into the existing "Given a RelicServer with in-flight requests" group.
| test( | ||
| 'when server.close(force: false) is called with in-flight requests, ' | ||
| 'then server waits for all requests to complete', |
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.
This test duplicates an existing test.
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.
Removed in f8f45c7. The test was redundant since the default behavior already tests graceful shutdown with in-flight requests.
| test( | ||
| 'when server.close() is called without force parameter, ' | ||
| 'then it defaults to graceful shutdown', | ||
| () async { |
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.
This feels overkill. Implicitly testing default value for force is false.
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.
Removed in f8f45c7. The default value for force is implicitly tested by the existing graceful shutdown test.
…cates Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
Description
Adds optional
forceparameter to serverclose()method enabling immediate shutdown that terminates in-flight requests. Defaults tofalseto preserve existing graceful shutdown behavior.Changes:
forceparameter (default:false) toAdapter.close()abstract methodIOAdapter.close()to pass through toHttpServer.close(force:)forceparameter through allRelicServerimplementations (_RelicServer,_IsolatedRelicServer,_MultiIsolateRelicServer)_FakeAdapterto match new signatureUsage:
Related Issues
Related to PR #292 (graceful shutdown testing)
Pre-Launch Checklist
///), ensuring consistency with existing project documentation.Breaking Changes
Additional Notes
Requested by @nielsenko. Enables custom timeout implementations for production environments where predictable shutdown timing is required.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.