ryucc commented on code in PR #27131:
URL: https://github.com/apache/beam/pull/27131#discussion_r1232639434
##########
runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/PortableBundleManager.java:
##########
@@ -110,15 +112,22 @@ private void scheduleNextBundleCheck() {
@Override
public void tryStartBundle() {
- currentBundleElementCount++;
+ currentBundleElementCount.incrementAndGet();
+ LOG.debug(
+ "tryStartBundle: elementCount={}, Bundle={}",
currentBundleElementCount, this.toString());
- if (!isBundleStarted) {
+ if (isBundleStarted.compareAndSet(false, true)) {
LOG.debug("Starting a new bundle.");
- isBundleStarted = true;
- bundleStartTime = System.currentTimeMillis();
- pendingBundleCount++;
+ bundleStartTime.set(System.currentTimeMillis());
+ pendingBundleCount.getAndIncrement();
bundleProgressListener.onBundleStarted();
}
+
+ if (!isBundleStarted.get() && currentBundleElementCount.get() != 0) {
+ LOG.warn(
+ "tryStartBundle: isBundleStarted = false, but
currentBundleElementCount = {}",
+ currentBundleElementCount);
Review Comment:
I thought it's more likely to catch an issue if there is a recent action, so
I put it at the end. Maybe putting at the start works as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]