Merged
Conversation
They relied on scanning async IO thread pool ports (`efile`) before . That only worked in Erlang versions < 21. Since then file IO was moved to dirty schedulers so listing efile ports doesn't yield any useful results. The partial fix is iterate through `processes()` and pick out the ones for which couch_file has put anything into the process dictionary. This will skip non-couch-file files but it's probably still better than nothing.
Contributor
Author
|
Example of usage: |
jaydoane
approved these changes
Jun 20, 2022
Contributor
jaydoane
left a comment
There was a problem hiding this comment.
Seems to work as expected:
(node1@127.0.0.1)8> length(couch_debug:opened_files()).
132
(node1@127.0.0.1)9> length(couch_debug:opened_files_contains("_global_change")).
8
(node1@127.0.0.1)10> length(couch_debug:opened_files_by_regexp(".*_global.*")).
8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They relied on scanning async IO thread pool ports (
efile) before . That only worked in Erlang versions < 21. Since then file IO was moved to dirty schedulers so listingefileports doesn't yield any useful results.The partial fix is iterate through
processes()and pick out the ones for which couch_file has put anything into the process dictionary. This will skip non-couch-file files but it's probably still better than nothing.