diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManager.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManager.java index 01174423c2..f42f48421a 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManager.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManager.java @@ -251,17 +251,6 @@ public class KafkaBasedEdgeGrpcSessionManager extends AbstractEdgeGrpcSessionMan } } - /** - * Readiness gate for the edge-event consumer (see {@link QueueConsumerManager}'s {@code readinessCheck}): it polls - * only while the session is connected and no sync or high-priority processing is running. - *

- * Pausing polling in those windows is deliberate. A batch that is polled but then skipped advances the Kafka - * position without committing, so it is lost until a rebalance; keeping events queued instead matches the no-loss - * behaviour the Postgres-based manager gets by re-reading by seqId. This covers the common case - a batch already - * in flight when a sync starts is a known residual (closing it would need seek/rewind, which {@code TbQueueConsumer} - * lacks). If a sync ever outran {@code max.poll.interval.ms} (default 5 min) the consumer is rebalanced and resumes - * from the committed offset: still no loss, just a possible replay. Edge syncs are seconds, so this is acceptable. - */ private boolean isReadyToProcessGeneralEvents() { return isSessionReady(getState()); } diff --git a/application/src/test/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManagerTest.java b/application/src/test/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManagerTest.java index 0759a6b05e..7ddc2af192 100644 --- a/application/src/test/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManagerTest.java +++ b/application/src/test/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManagerTest.java @@ -54,13 +54,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -/** - * Unit tests for the readiness gate that {@link KafkaBasedEdgeGrpcSessionManager} feeds into its edge-event consumer. - *

- * The generic poll-gate mechanism is covered by {@code QueueConsumerManagerTest}; these tests pin the edge-specific - * half of the fix: the manager's readiness predicate, and the fact that the consumer is actually wired with it - so - * dropping the {@code .readinessCheck(...)} builder line would silently reintroduce the event-loss bug. - */ class KafkaBasedEdgeGrpcSessionManagerTest { private static final long POLL_INTERVAL_MS = 20L;