Browse Source

Remove comments

pull/15766/head
Andrii Landiak 1 month ago
parent
commit
4f8dcb3dce
  1. 11
      application/src/main/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManager.java
  2. 7
      application/src/test/java/org/thingsboard/server/service/edge/rpc/session/manager/KafkaBasedEdgeGrpcSessionManagerTest.java

11
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.
* <p>
* 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());
}

7
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.
* <p>
* 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;

Loading…
Cancel
Save