Skip to content

Commit

Permalink
Fix for a failing Kafka operator job
Browse files Browse the repository at this point in the history
  • Loading branch information
fedinskiy committed Oct 13, 2022
1 parent 9a42e79 commit 7971990
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class BaseService<T extends Service> implements Service {
private final Map<String, String> properties = new HashMap<>();
private final List<Runnable> futureProperties = new LinkedList<>();

//TODO workaround for https://github.com/fabric8io/kubernetes-client/issues/4491
private volatile boolean isStopped = false;

private ManagedResourceBuilder managedResourceBuilder;
private ManagedResource managedResource;
private String serviceName;
Expand Down Expand Up @@ -205,8 +208,8 @@ public void start() {
* Stop the Quarkus application.
*/
@Override
public void stop() {
if (!isRunning()) {
public synchronized void stop() {
if (isStopped || !isRunning()) {
return;
}

Expand All @@ -215,6 +218,7 @@ public void stop() {
managedResource.stop();

Log.info(this, "Service stopped (%s)", getDisplayName());
isStopped = true;
}

/**
Expand Down

0 comments on commit 7971990

Please sign in to comment.