-
Notifications
You must be signed in to change notification settings - Fork 529
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
Pool file handles used by StreamBinaryReader components #3703
Conversation
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.
Unblocking with feedback
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.
Looks good to me. It might be good to add some tests to exercise the pooling behaviour, for example:
- create a second
Decbuf
while holding the first open - retrieve a new
Decbuf
from the factory after closing one (and therefore returning the file handle to the pool) and check that the file handle is reset correctly etc.
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, thanks!
Add a pool of file handles to avoid the cost of opening and closing files for each operation that needs access to the index-header file (symbols and posting offsets). See #3465 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Test for multiple Decbuf created at the same time * Unexport FileReader Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
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.
Great job! I did a relatively quick review, but I couldn't spot any issue. I just left few minor comments.
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
e855bc3
to
d89dbc6
Compare
I ended up implementing the change described here because the logic for cleanup was getting a little confusing being split between the |
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
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.
Three very minor nits but otherwise LGTM.
Co-authored-by: Charles Korn <charleskorn@users.noreply.github.com>
Co-authored-by: Charles Korn <charleskorn@users.noreply.github.com>
Add a pool of file handles to avoid the cost of opening and closing files for each operation that needs access to the index-header file (symbols and posting offsets). See grafana#3465 Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
What this PR does
Add a pool of file handles to avoid the cost of opening and closing files for each operation that needs access to the index-header file (symbols and posting offsets). The default number of handles to keep per index-header is
1
to maintain parity with the existing mmap implementation (which keeps a single file handle for the index-header open for the duration of the reader).Which issue(s) this PR fixes or relates to
See #3465
Benchmark
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]