Skip to content

Commit

Permalink
Make the FunctionRunTimeManager methods used by rest-api syncrhonized…
Browse files Browse the repository at this point in the history
… since the assignment tailer also is updating it (apache#6786)

This fixes the flakiness in PulsarFunctionE2ESecurityTest

Co-authored-by: Sanjeev Kulkarni <[email protected]>
  • Loading branch information
srkukarni and Sanjeev Kulkarni authored Apr 21, 2020
1 parent c091bd7 commit fb930b7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public synchronized void removeAssignments(Collection<Assignment> assignments) {
}
}

public void restartFunctionInstance(String tenant, String namespace, String functionName, int instanceId,
public synchronized void restartFunctionInstance(String tenant, String namespace, String functionName, int instanceId,
URI uri) throws Exception {
if (runtimeFactory.externallyManaged()) {
throw new WebApplicationException(Response.serverError().status(Status.NOT_IMPLEMENTED)
Expand Down Expand Up @@ -368,7 +368,7 @@ public void restartFunctionInstance(String tenant, String namespace, String func
}
}

public void restartFunctionInstances(String tenant, String namespace, String functionName)
public synchronized void restartFunctionInstances(String tenant, String namespace, String functionName)
throws Exception {
final String fullFunctionName = String.format("%s/%s/%s", tenant, namespace, functionName);
Collection<Assignment> assignments = this.findFunctionAssignments(tenant, namespace, functionName);
Expand Down

0 comments on commit fb930b7

Please sign in to comment.