Skip to content

fix: processor concurrency issue on startup #2328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ public synchronized void stop() {
}

@Override
public void start() throws OperatorException {
public synchronized void start() throws OperatorException {
log.debug("Starting event processor: {}", this);
// on restart new executor service is created and needs to be set here
executor = controllerConfiguration.getConfigurationService().getExecutorServiceManager()
.reconcileExecutorService();
Expand All @@ -410,6 +411,7 @@ public void start() throws OperatorException {

private void handleAlreadyMarkedEvents() {
for (var state : resourceStateManager.resourcesWithEventPresent()) {
log.debug("Handling already marked event on start. State: {}", state);
handleMarkedEventForResource(state);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ private PostExecutionControl<P> handleDispatch(ExecutionScope<P> executionScope)
throws Exception {
P originalResource = executionScope.getResource();
var resourceForExecution = cloneResource(originalResource);
log.debug("Handling dispatch for resource {}", getName(originalResource));
log.debug("Handling dispatch for resource name: {} namespace: {}", getName(originalResource),
originalResource.getMetadata().getNamespace());

final var markedForDeletion = originalResource.isMarkedForDeletion();
if (markedForDeletion && shouldNotDispatchToCleanupWhenMarkedForDeletion(originalResource)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,15 @@ public void unMarkEventReceived() {
break;
}
}

@Override
public String toString() {
return "ResourceState{" +
"id=" + id +
", underProcessing=" + underProcessing +
", retry=" + retry +
", eventing=" + eventing +
", rateLimit=" + rateLimit +
'}';
}
}