DBZ-1889 Prevent Connect throttling while connection is down
This commit is contained in:
parent
224f97e380
commit
d2bdcd1ab3
@ -34,6 +34,8 @@
|
||||
*/
|
||||
public abstract class BaseSourceTask extends SourceTask {
|
||||
|
||||
private static final int PAUSE_WHEN_NOT_STARTED = 2_000;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BaseSourceTask.class);
|
||||
|
||||
protected static enum State {
|
||||
@ -117,6 +119,10 @@ public final List<SourceRecord> poll() throws InterruptedException {
|
||||
|
||||
// in backoff period after a retriable exception
|
||||
if (!started) {
|
||||
// WorkerSourceTask calls us immediately after we return the empty list.
|
||||
// This turns into a throttling so we need to make a pause before we return
|
||||
// the control back.
|
||||
Thread.sleep(PAUSE_WHEN_NOT_STARTED);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user