albertogpz commented on a change in pull request #6663:
URL: https://github.com/apache/geode/pull/6663#discussion_r679015627
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -1404,13 +1404,19 @@ void
peekEventsFromIncompleteTransactions(List<GatewaySenderEventImpl> batch,
}
}
if (incompleteTransactionIdsInBatch.size() == 0 ||
- retries++ == GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES) {
+ retries >= sender.getRetriesToGetTransactionEventsFromQueue()) {
break;
}
+ retries++;
Review comment:
Yes, as you say, this is a best effort.
Given that setting a high value for the wait could lead to delaying too much
the replication, which could eventually provoke that queues grow indefinitely,
I opted for setting a low value.
Also, in case of a misconfiguration (one not detected at configuration time)
due to having transactions with events going to different gateway senders, it
could be that it is impossible for the batch to contain the complete
transaction. In that case, the maximum time will be consumed
(retries*wait_time).
Regarding using wait/notify, I have not thought about it that much. I guess
we could call notify when an element is added to the queue and call wait
instead of sleep. But, if it makes sense to have a small sleep, then using wait
and notify may be inefficient. Do you think it is worth to change it to
wait/notify?
--
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]