-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Amend File API design document to address file.Close
constraints
#3328
Conversation
c73eeed
to
afed1ec
Compare
afed1ec
to
5fb9565
Compare
5fb9565
to
8888836
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3328 +/- ##
==========================================
+ Coverage 73.16% 73.33% +0.16%
==========================================
Files 258 258
Lines 19912 19645 -267
==========================================
- Hits 14569 14407 -162
+ Misses 4418 4353 -65
+ Partials 925 885 -40
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
@oleiade We should move this change to the possible future improvements
section and update it by integrating #3149 (comment).
Agreed 👍🏻 What did you refer to as the |
@codebien I see, you meant the one in the file directly 🙇🏻 Fair enough, I'll amend the document 👍🏻 |
8888836
to
4528f56
Compare
✅ |
What?
This Pull Request updates the File API design document, focusing on the limitations of the
file.Close
operation, especially when files are opened in the init context.Why?
The current design treats the
file.Close
operation as a non-operation, as detailed in #3314. This choice was by design, as we anticipated changing this once k6 can open files during the VU stage.We've explored an alternative where k6 tracks how many times a file has been opened. When this count reaches zero, k6 would free up the memory holding the file content. More details can be found in the proof-of-concept for this approach.
A challenge arose: opening files in the init context means the count might never reach zero. This is because the file keeps a reference until the test concludes.
After discussions with @codebien, we agreed that due to k6's lifecycle stages and the init context's frequent calls, the best approach would be to:
When #3020 is in place, our plan is to adjust this so that files opened exclusively in the VU stage can have their memory released earlier, given they are consistently closed in that stage.
Refs
#3149
#3101
#3314
#3020