You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/07/21 20:02:20 UTC

[GitHub] [couchdb] davisp commented on a change in pull request #2077: Make sure that fsync errors are raised

davisp commented on a change in pull request #2077: Make sure that fsync errors are raised
URL: https://github.com/apache/couchdb/pull/2077#discussion_r305633606
 
 

 ##########
 File path: src/couch/src/couch_file.erl
 ##########
 @@ -215,12 +215,26 @@ truncate(Fd, Pos) ->
 sync(Filepath) when is_list(Filepath) ->
     case file:open(Filepath, [append, raw]) of
         {ok, Fd} ->
-            try ok = file:sync(Fd) after ok = file:close(Fd) end;
+            try
+                case file:sync(Fd) of
+                    ok ->
+                        ok;
+                    Else ->
+                        erlang:error({fsync_error, Else})
 
 Review comment:
   What do you mean by "fully restart"? In terms of the database and outstanding writes and re-applying writes that'd be at the first error since couch_file exiting will take down couch_db_updater and friends.
   
   In terms of restarting the entire `beam.smp` process I'd think it'd depend on the error itself. Normally when EIO happens and the filesystem panics into read-only we tend to spew a lot of errors from various places which ends up causing supervision to restart the process eventually. In terms of ENOSPC or similar I think we'd never completely restart unless we happen to bubble up through the auth cache trying to write users or being unable to write docs into the dbs database or some other system related write activity.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services