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 2020/05/29 21:03:01 UTC

[GitHub] [couchdb] nickva opened a new pull request #2918: Guard couch_jobs:accept_loop timing out

nickva opened a new pull request #2918:
URL: https://github.com/apache/couchdb/pull/2918


   And also against too many conflicts during overload
   
   


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



[GitHub] [couchdb] chewbranca commented on a change in pull request #2918: Guard couch_jobs:accept_loop timing out

Posted by GitBox <gi...@apache.org>.
chewbranca commented on a change in pull request #2918:
URL: https://github.com/apache/couchdb/pull/2918#discussion_r432746370



##########
File path: src/couch_jobs/src/couch_jobs.erl
##########
@@ -297,9 +297,17 @@ accept_loop(Type, NoSched, MaxSchedTime, Timeout) ->
     TxFun =  fun(JTx) ->
         couch_jobs_fdb:accept(JTx, Type, MaxSchedTime, NoSched)
     end,
-    case couch_jobs_fdb:tx(couch_jobs_fdb:get_jtx(), TxFun) of
+    AcceptResult = try
+        couch_jobs_fdb:tx(couch_jobs_fdb:get_jtx(), TxFun)
+    catch
+        error:{erlfdb_error, Err} when Err =:= 1020 orelse Err =:= 1031 ->
+            retry
+    end,
+    case AcceptResult of
         {ok, Job, Data} ->
             {ok, Job, Data};
+        retry ->
+            accept_loop(Type, NoSched, MaxSchedTime, Timeout);

Review comment:
       Am I reading this correctly that this will retry loop forever in the event it continues to timeout? Is there something else that will time this out? Or do we want to just retry indefinitely for jobs?




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



[GitHub] [couchdb] nickva merged pull request #2918: Guard couch_jobs:accept_loop timing out

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


   


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



[GitHub] [couchdb] nickva commented on a change in pull request #2918: Guard couch_jobs:accept_loop timing out

Posted by GitBox <gi...@apache.org>.
nickva commented on a change in pull request #2918:
URL: https://github.com/apache/couchdb/pull/2918#discussion_r432746992



##########
File path: src/couch_jobs/src/couch_jobs.erl
##########
@@ -297,9 +297,17 @@ accept_loop(Type, NoSched, MaxSchedTime, Timeout) ->
     TxFun =  fun(JTx) ->
         couch_jobs_fdb:accept(JTx, Type, MaxSchedTime, NoSched)
     end,
-    case couch_jobs_fdb:tx(couch_jobs_fdb:get_jtx(), TxFun) of
+    AcceptResult = try
+        couch_jobs_fdb:tx(couch_jobs_fdb:get_jtx(), TxFun)
+    catch
+        error:{erlfdb_error, Err} when Err =:= 1020 orelse Err =:= 1031 ->
+            retry
+    end,
+    case AcceptResult of
         {ok, Job, Data} ->
             {ok, Job, Data};
+        retry ->
+            accept_loop(Type, NoSched, MaxSchedTime, Timeout);

Review comment:
       We are ok retrying it forever in a loop in case of transaction timeouts. We will exit the loop with `{error, not_found}` in case the user specifies a `Timeout` option but we don't want the global (default) transaction settings to affect indexers waiting to accept jobs




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