From 0d173b449108658f9e6404a52303a985565b8315 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Sat, 25 Sep 2010 11:26:39 +0000 Subject: Explicitely close the file descriptor. It doesn't hurt. Also, since we open the file in 'raw' mode, I suspect the file descriptor is not closed when the couch_file server dies. From erl -man file: "The raw option allows faster access to a file, because no Erlang process is needed to handle the file." For me, no Erlang process handling the file means that it's likely the file is not closed by any other process. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001196 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_file.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_file.erl') diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl index aae89d7f..860c9f4e 100644 --- a/src/couchdb/couch_file.erl +++ b/src/couchdb/couch_file.erl @@ -278,8 +278,8 @@ maybe_track_open_os_files(FileOptions) -> couch_stats_collector:track_process_count({couchdb, open_os_files}) end. -terminate(_Reason, _Fd) -> - ok. +terminate(_Reason, #file{fd = Fd}) -> + ok = file:close(Fd). handle_call({pread_iolist, Pos}, _From, File) -> -- cgit v1.2.3