Skip to content

chore: remove eventing completion await#2503

Open
cristianonicolai wants to merge 1 commit into
TimefoldAI:mainfrom
cristianonicolai:chore/messaging
Open

chore: remove eventing completion await#2503
cristianonicolai wants to merge 1 commit into
TimefoldAI:mainfrom
cristianonicolai:chore/messaging

Conversation

@cristianonicolai

@cristianonicolai cristianonicolai commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the worker post-processing flow to propagate the solveRequested flag into post-processors, and changes solver worker event emission to be non-blocking (no longer awaiting event-send completion).

Changes:

  • Extend ModelPostProcessor.processComputed(...) to accept a solveRequested boolean and pass it through from SolverWorker.
  • Update existing processComputed(...) implementations to match the new signature.
  • Replace blocking event-send awaiting with asynchronous completion logging when emitting events.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
service/worker/src/main/java/ai/timefold/solver/service/worker/impl/SolverWorker.java Passes solveRequested into post-processing and makes event emission non-blocking with async error logging.
service/worker/src/main/java/ai/timefold/solver/service/worker/impl/log/LogsPostProcessor.java Updates processComputed signature to accept solveRequested.
service/maps/service-client/src/main/java/ai/timefold/solver/service/maps/service/client/impl/processors/SaveWaypointsPostProcessor.java Updates processComputed signature to accept solveRequested.
service/definition/src/main/java/ai/timefold/solver/service/definition/api/ModelPostProcessor.java Changes processComputed API to include solveRequested.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment on lines 244 to +248
private void sendEvent(Emitter emitter, AbstractEvent event) {
try {
emitter.send(event).toCompletableFuture().get(EMITTER_TIMEOUT, TimeUnit.SECONDS);
} catch (ExecutionException | InterruptedException | TimeoutException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
LOGGER.error("Error sending event: {}, message: {}", event, e.getMessage(), e);
CompletionStage<Void> stage = emitter.send(event);
stage.whenComplete((v, ex) -> {
if (ex == null) {
Copilot AI review requested due to automatic review settings July 15, 2026 13:51
@cristianonicolai cristianonicolai changed the title chore: Add solveRequested to postprocessor and remove eventing comple… chore: remove eventing completion await Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 13:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings July 15, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +246 to +250
CompletionStage<Void> stage = emitter.send(event);
stage.whenComplete((v, ex) -> {
if (ex == null) {
return;
}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +248 to +254
stage.whenComplete((v, ex) -> {
if (ex == null) {
return;
}
var cause = ex.getCause() != null ? ex.getCause() : ex;
LOGGER.error("Error sending event: {}, message: {}", event, cause.getMessage(), cause);
});
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants