Skip to content

Commit

Permalink
move sendPushJobDetailsToController to catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourav Maji committed Feb 28, 2024
1 parent 3c8d490 commit e555812
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,8 @@ public void run() {
sendPushJobDetailsToController();
closeVeniceWriter();
} catch (Exception ex) {
sendPushJobDetailsToController();
closeVeniceWriter();
LOGGER.error(
"Error before killing the failed push job; still issue the kill job command to clean up states in backend",
ex);
Expand Down Expand Up @@ -2434,7 +2436,6 @@ void pollStatusUntilComplete(
// but if the majority of datacenters have completed, we give up on the unreachable datacenter
// and start truncating the data topic.
// 2) For targeted region push, not all targeted regions have completed.

StringBuilder errorMsg = new StringBuilder().append("Push job error reported by controller: ")
.append(pushJobSetting.veniceControllerUrl)
.append("\ncontroller response: ")
Expand All @@ -2455,7 +2456,6 @@ void pollStatusUntilComplete(
VenicePushJob.this.pushJobSetting.storeResponse.getStore().getBootstrapToOnlineTimeoutInHours();
long durationMs = System.currentTimeMillis() - pollStartTimeMs;
if (durationMs > TimeUnit.HOURS.toMillis(bootstrapToOnlineTimeoutInHours)) {
sendPushJobDetailsToController();
throw new VeniceException(
"Failing push-job for store " + VenicePushJob.this.pushJobSetting.storeResponse.getName()
+ " which is still running after " + TimeUnit.MILLISECONDS.toHours(durationMs) + " hours.");
Expand All @@ -2469,7 +2469,6 @@ void pollStatusUntilComplete(
double elapsedMinutes = (double) (System.currentTimeMillis() - unknownStateStartTimeMs) / Time.MS_PER_MINUTE;
LOGGER.warn("Some data centers are still in unknown state after waiting for {} minutes", elapsedMinutes);
} else {
sendPushJobDetailsToController();
long timeoutMinutes = pushJobSetting.jobStatusInUnknownStateTimeoutMs / Time.MS_PER_MINUTE;
throw new VeniceException(
"After waiting for " + timeoutMinutes + " minutes; push job is still in unknown state.");
Expand Down

0 comments on commit e555812

Please sign in to comment.