diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-07-12 15:31:00 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-07-12 15:31:00 +0100 |
| commit | f2b022b15ac47ccddf0f4f17152f79d19b74f5c9 (patch) | |
| tree | 19afc9b2add4798b8a4a9817a5fc47c5d65c924b /src | |
| parent | 63477af925d226c937aee6984c6380699ede0a11 (diff) | |
| download | rabbitmq-server-git-f2b022b15ac47ccddf0f4f17152f79d19b74f5c9.tar.gz | |
Don't reopen file handles in fhc:needs_sync/1, avoid infinite loop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/file_handle_cache.erl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index f3b4dbafa2..e8788c9798 100644 --- a/src/file_handle_cache.erl +++ b/src/file_handle_cache.erl @@ -374,11 +374,12 @@ sync(Ref) -> end). needs_sync(Ref) -> - with_handles( - [Ref], - fun ([#handle { is_dirty = false, write_buffer = [] }]) -> false; - ([_Handle]) -> true - end). + %% This needs *not* to use with_handles/2; see bug 25052 + Handle = get({Ref, fhc_handle}), + case Handle of + #handle { is_dirty = false, write_buffer = [] } -> false; + _ -> true + end. position(Ref, NewOffset) -> with_flushed_handles( |
