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.
  • Loading branch information
fbergkemper authored and joergsteffens committed Sep 16, 2017
1 parent 3c8f257 commit 751787a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dird/ua_status.c
Expand Up @@ -253,6 +253,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 @@ -284,9 +285,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 @@ -318,9 +322,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 751787a

Please sign in to comment.