Skip to content
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

[Bug] SlidingWindowBatchWorkflowImpl.java recived signals are getting ignored if currentRecords is empty #510

Open
stiwari99 opened this issue Aug 8, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@stiwari99
Copy link

stiwari99 commented Aug 8, 2023

What are you really trying to do?

Describe the bug

If signal is received when currentRecords is empty instead of null then it will not add it to recordsToRemove list which is causing Workflow.await(() -> currentRecords.size() == 0); to wait indefinite
https://github.com/temporalio/samples-java/blob/main/core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowImpl.java#L130

Current Code

 if (currentRecords == null) {
      recordsToRemove.add(recordId);
      return;
    }

Expected change

 if (currentRecords == null || currentRecords.isEmpty()) {
      recordsToRemove.add(recordId);
      return;
    }

Minimal Reproduction

Environment/Versions

  • OS and processor: [e.g. M1 Mac, x86 Windows, Linux]
  • Temporal Version: [e.g. 1.14.0?] and/or SDK version
  • Are you using Docker or Kubernetes or building Temporal from source?

Additional context

@stiwari99 stiwari99 added the bug Something isn't working label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant