merlimat commented on PR #25642: URL: https://github.com/apache/pulsar/pull/25642#issuecomment-4359961595
@lhotari thanks for the review — addressed all three in 300b3dc3377: 1. **Backoff reset on a pending task** — added `resetAndRearmDrainPoll()` that cancels the in-flight `drainPollTask` before resetting and re-arming. Used everywhere a progress event happens (register, layout change, observed drain). 2. **`close()` race with in-flight poll** — added a `closed` flag set by `close()`, checked in both `ensureDrainPollerRunning` and `pollDrainStatus` so the `whenComplete` rearm path becomes a no-op once the coordinator has been closed. 3. **Restore-path STREAM default** — restore now creates the coordinator with `null` drain checker (no enforcement). On first register-after-restore, `ScalableTopicController` installs a real checker via the new `SubscriptionCoordinator.installDrainChecker(...)` if and only if the consumer type is STREAM. CHECKPOINT / QUEUE subscriptions stay un-blocked. Persisting the type in metadata is the proper long-term fix and noted in the code comment as a follow-up. Four new unit tests in `SubscriptionCoordinatorTest` covering each fix: - `testFreshRegisterCancelsBackedOffPollAndRearmsImmediately` - `testCloseRaceWithInFlightPollDoesNotLeakRearm` - `testRestoredCoordinatorStartsWithoutParentDrainOrdering` - `testInstallDrainCheckerAfterRestoreEnablesOrdering` All tests pass; checkstyle clean. -- 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]
