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 2022/07/14 23:24:45 UTC

[GitHub] [couchdb] noahshaw11 opened a new pull request, #4111: Fix not_found error smoosh

noahshaw11 opened a new pull request, #4111:
URL: https://github.com/apache/couchdb/pull/4111

   ## Overview
   
   There is a subtle race condition where smoosh attempts to open a deleted db when remonitoring a compaction job or starting a compaction job. This PR handles `not_found` errors for these two cases.
   
   ## Testing recommendations
   
   `make eunit apps=smoosh`
   
   ## Related Issues or Pull Requests
   
   ## Checklist
   
   - [ ] Code is written and works correctly
   - [ ] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
   


-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva commented on a diff in pull request #4111: Fix not_found error smoosh

Posted by GitBox <gi...@apache.org>.
nickva commented on code in PR #4111:
URL: https://github.com/apache/couchdb/pull/4111#discussion_r921690688


##########
src/smoosh/src/smoosh_channel.erl:
##########
@@ -472,11 +472,19 @@ maybe_start_compaction(State) ->
 start_compact(State, DbName) when is_list(DbName) ->
     start_compact(State, ?l2b(DbName));
 start_compact(State, DbName) when is_binary(DbName) ->
-    {ok, Db} = couch_db:open_int(DbName, []),
-    try
-        start_compact(State, Db)
-    after
-        couch_db:close(Db)
+    case couch_db:open_int(DbName, []) of
+        {ok, Db} ->
+            try
+                start_compact(State, Db)
+            after
+                couch_db:close(Db)
+            end;
+        {not_found, no_db_file} ->

Review Comment:
   Minor nit: to avoid repeating the error below can do `Err = {not_found, no_db_file}  ->` then in the warning use `Err`
   
   



-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva merged pull request #4111: Fix not_found error smoosh

Posted by GitBox <gi...@apache.org>.
nickva merged PR #4111:
URL: https://github.com/apache/couchdb/pull/4111


-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] noahshaw11 commented on a diff in pull request #4111: Fix not_found error smoosh

Posted by GitBox <gi...@apache.org>.
noahshaw11 commented on code in PR #4111:
URL: https://github.com/apache/couchdb/pull/4111#discussion_r921691565


##########
src/smoosh/src/smoosh_channel.erl:
##########
@@ -472,11 +472,19 @@ maybe_start_compaction(State) ->
 start_compact(State, DbName) when is_list(DbName) ->
     start_compact(State, ?l2b(DbName));
 start_compact(State, DbName) when is_binary(DbName) ->
-    {ok, Db} = couch_db:open_int(DbName, []),
-    try
-        start_compact(State, Db)
-    after
-        couch_db:close(Db)
+    case couch_db:open_int(DbName, []) of
+        {ok, Db} ->
+            try
+                start_compact(State, Db)
+            after
+                couch_db:close(Db)
+            end;
+        {not_found, no_db_file} ->

Review Comment:
   Changed, thanks Nick.



-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org