rnewson commented on code in PR #6114:
URL: https://github.com/apache/couchdb/pull/6114#discussion_r4006583522


##########
src/couch/test/eunit/couch_file_tests.erl:
##########
@@ -21,6 +21,8 @@
 setup() ->
     {ok, Fd} = couch_file:open(?tempfile(), [create, overwrite]),
     meck:new(file, [passthrough, unstick]),
+    config:set_boolean("couch_file", "append_bin_eof_check", true),

Review Comment:
   done



##########
src/couch/src/couch_file.erl:
##########
@@ -1017,6 +1028,22 @@ dup(#file{fd = Fd} = File) ->
             File
     end.
 
+validate_eof(#file{} = File, Key, Default) when is_list(Key), 
is_boolean(Default) ->
+    case config:get_boolean("couch_file", Key, Default) of
+        false ->
+            ok;
+        true ->
+            {ok, ActualPos} = file:position(File#file.fd, eof),
+            if
+                File#file.eof /= ActualPos ->
+                    throw_stop(
+                        {eof_mismatch, Key, ActualPos, File#file.eof, 
File#file.filepath}, File

Review Comment:
   done



##########
src/couch/src/couch_file.erl:
##########
@@ -1017,6 +1028,22 @@ dup(#file{fd = Fd} = File) ->
             File
     end.
 
+validate_eof(#file{} = File, Key, Default) when is_list(Key), 
is_boolean(Default) ->
+    case config:get_boolean("couch_file", Key, Default) of

Review Comment:
   done



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to