Skip to content

Commit

Permalink
Remove workerId parameter from postWorkerError. (#17072)
Browse files Browse the repository at this point in the history
* Remove workerId parameter from postWorkerError.

It was redundant to MSQErrorReport#getTaskId.

* Fix javadoc.
  • Loading branch information
gianm authored and kfaraz committed Oct 4, 2024
1 parent 50a5f9c commit a975ac9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void updatePartialKeyStatisticsInformation(
* taskId, not by query/stage/worker, because system errors are associated
* with a task rather than a specific query/stage/worker execution context.
*
* @see ControllerClient#postWorkerError(String, MSQErrorReport)
* @see ControllerClient#postWorkerError(MSQErrorReport)
*/
void workerError(MSQErrorReport errorReport);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ void postResultsComplete(
/**
* Client side method to inform the controller that the error has occured in the given worker.
*/
void postWorkerError(
String workerId,
MSQErrorReport errorWrapper
) throws IOException;
void postWorkerError(MSQErrorReport errorWrapper) throws IOException;

/**
* Client side method to inform the controller about the warnings generated by the given worker.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void run()
log.warn("%s", logMessage);

if (controllerAlive) {
controllerClient.postWorkerError(context.workerId(), errorReport);
controllerClient.postWorkerError(errorReport);
}

if (t != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ public void postResultsComplete(StageId stageId, int workerNumber, @Nullable Obj
}

@Override
public void postWorkerError(String workerId, MSQErrorReport errorWrapper) throws IOException
public void postWorkerError(MSQErrorReport errorWrapper) throws IOException
{
final String path = StringUtils.format(
"/workerError/%s",
StringUtils.urlEncode(workerId)
StringUtils.urlEncode(errorWrapper.getTaskId())
);

doRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void publishException(int stageNumber, Throwable e)
// Send the warning as an error if it is disallowed altogether
if (criticalWarningCodes.contains(errorCode)) {
try {
controllerClient.postWorkerError(workerId, MSQErrorReport.fromException(workerId, host, stageNumber, e));
controllerClient.postWorkerError(MSQErrorReport.fromException(workerId, host, stageNumber, e));
}
catch (IOException postException) {
throw new RE(postException, "Failed to post the worker error [%s] to the controller", errorCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void postResultsComplete(StageId stageId, int workerNumber, @Nullable Obj
}

@Override
public void postWorkerError(String workerId, MSQErrorReport errorWrapper)
public void postWorkerError(MSQErrorReport errorWrapper)
{
controller.workerError(errorWrapper);
}
Expand Down

0 comments on commit a975ac9

Please sign in to comment.