basho / bitcask

because you need another a key/value storage engine
1.29k stars 173 forks source link

has_valid_hintfile leaked a hintfile file descriptor [JIRA: RIAK-2316] #227

Closed jonmeredith closed 8 years ago

jonmeredith commented 8 years ago

The has_valid_hintfile function opened the file, then recursively called hintfile_validate_loop until the end of file or error. Either way it does not close the file.

has_valid_hintfile is called as part of opening a bitcask via fold_keys(..., recovery, ...) via bitcask:scan_keyfiles/5 so the descriptors are leaked each time the bitcask is opened.

Fixed by adding a try/after block around the hintfile_validate_loop/3

Passed ./rebar eunit locally

  All 95 tests passed.
jonmeredith commented 8 years ago

create jira issue

Basho-JIRA commented 8 years ago

PR ready for review.

Found by JohnC onsite at customer.

_[posted via JIRA by Jon Meredith]_

JeetKunDoug commented 8 years ago

:+1: 52bce9c

JeetKunDoug commented 8 years ago

@borshop merge

Basho-JIRA commented 8 years ago

Once merged, we'll have to re-tag bitcask and bump appropriate rebar.config files.

_[posted via JIRA by Douglas Rohrer]_

Basho-JIRA commented 8 years ago

Completed and merged.

_[posted via JIRA by Douglas Rohrer]_

Basho-JIRA commented 8 years ago

Merged to patch-1.7.2 and 1.7 branches. patch-1.7.2 tagged 1.7.2p1

_[posted via JIRA by Douglas Rohrer]_