nzw921rx commented on PR #10609:
URL: https://github.com/apache/seatunnel/pull/10609#issuecomment-4127196898
> 5\. No lower bound on batch_interval_ms
>
> Setting batch_interval_ms = 1 would cause 1000 scheduler wakeups/second.
Each is a no-op when batchCount = 0 but the lock acquisition overhead adds up
under high throughput. Worth adding a minimum value check or at least a WARN
for values below a reasonable threshold (e.g. 100ms).
Thanks @ricky2129
The final repair logic is as follows
```
// batchIntervalMs <= 0 print debug log
if (batchIntervalMs <= 0){
LOG.debug("JDBC periodic flush disabled, batch_interval_ms={}",
batchIntervalMs);
return null;
}
// batchIntervalMs < 100ms warn log
if (batchIntervalMs < MIN_BATCH_INTERVAL_MS) {
LOG.warn("JDBC batch interval {}ms is too small, recommended
minimum is {}ms",
batchIntervalMs, MIN_BATCH_INTERVAL_MS);
}
// Fix incorrect thread ID retrieval
executor =
Executors.newScheduledThreadPool(
1,
runnable -> {
Thread thread = new Thread(runnable);
thread.setDaemon(true);
thread.setName(
"jdbc-batch-flush-scheduler-" +
thread.getId());
return thread;
});
```
--
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]