nickva commented on a change in pull request #2924:
URL: https://github.com/apache/couchdb/pull/2924#discussion_r434816654
##########
File path: src/couch_jobs/src/couch_jobs.erl
##########
@@ -385,10 +385,13 @@ wait_any(Subs, State, Timeout0, ResendQ) when
end.
-limit_timeout(Timeout) when is_integer(Timeout), Timeout < 16#FFFFFFFF ->
+limit_timeout(_Timeout, true) ->
+ infinity;
+
+limit_timeout(Timeout, false) when is_integer(Timeout), Timeout < 16#FFFFFFFF
->
Timeout;
-limit_timeout(_Timeout) ->
+limit_timeout(_Timeout, false) ->
Review comment:
In the previous clause we return `infinity` if `NoSched` option is
`true`. But that value is not passed directly to `erlfdb:wait(...)` it is then
compared with `UserTimeout`
https://github.com/apache/couchdb/blob/prototype/fdb-layer/src/couch_jobs/src/couch_jobs.erl#L336
and we pass that to `erlfdb:wait(...)`.
We basically say that when `NoSched` is `true` we shouldn't pay attention
the `MaxSTime` parameter when deciding how long or if to timeout at all when we
wait 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:
[email protected]