Skip to content

Commit

Permalink
Reset JobStatus to previous JobStatus in status SD and FD loops
Browse files Browse the repository at this point in the history
We need to reset the JobStatus value to its previous after each storage or client status call,
otherwise if we receive an JS_Error for one storage or client, all the following status calls
will fail as well.

This could happen for example if a client or storage is offline but more status calls to other
clients and storages will follow in the loop.

(cherry picked from commit 751787a)
  • Loading branch information
fbergkemper authored and sduehr committed May 4, 2018
1 parent 1becba1 commit cb5d872
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dird/ua_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ static void do_all_status(UAContext *ua)
CLIENTRES *client, **unique_client;
int i, j;
bool found;
int32_t previous_JobStatus = 0;

do_director_status(ua);

Expand Down Expand Up @@ -282,9 +283,12 @@ static void do_all_status(UAContext *ua)
}
UnlockRes();

previous_JobStatus = ua->jcr->JobStatus;

/* Call each unique Storage daemon */
for (j = 0; j < i; j++) {
storage_status(ua, unique_store[j], NULL);
ua->jcr->JobStatus = previous_JobStatus;
}
free(unique_store);

Expand Down Expand Up @@ -316,9 +320,12 @@ static void do_all_status(UAContext *ua)
}
UnlockRes();

previous_JobStatus = ua->jcr->JobStatus;

/* Call each unique File daemon */
for (j = 0; j < i; j++) {
client_status(ua, unique_client[j], NULL);
ua->jcr->JobStatus = previous_JobStatus;
}
free(unique_client);

Expand Down

0 comments on commit cb5d872

Please sign in to comment.