tonysun83 commented on a change in pull request #1277: In _scheduler/docs fix 
`crashing` state showing as `pending` sometimes
URL: https://github.com/apache/couchdb/pull/1277#discussion_r180845189
 
 

 ##########
 File path: src/couch_replicator/src/couch_replicator_scheduler.erl
 ##########
 @@ -138,11 +138,15 @@ job_summary(JobId, HealthThreshold) ->
             ErrorCount = consecutive_crashes(History, HealthThreshold),
             {State, Info} = case {Pid, ErrorCount} of
                 {undefined, 0}  ->
-                    {pending, null};
+                    case History of
 
 Review comment:
   Since we're checking History in both instances of ErrorCount could we do it 
like this:
   
   ```
   {undefined, _ErrorCount} ->
       case History of
            [{{crashed, Error}, _When} | _] ->
                {crashing, crash_reason_json(Error)};
            [_ | _] ->
                {pending, null}
       end
   ```
   ?

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


With regards,
Apache Git Services

Reply via email to