rkhachatryan commented on a change in pull request #17229:
URL: https://github.com/apache/flink/pull/17229#discussion_r743933585
##########
File path:
flink-dstl/flink-dstl-dfs/src/main/java/org/apache/flink/changelog/fs/BatchingStateChangeUploader.java
##########
@@ -121,18 +127,17 @@ public void upload(UploadTask uploadTask) {
}
LOG.debug("persist {} changeSets", uploadTask.changeSets.size());
try {
- checkState(
- inFlightBytesCounter.sum() <= maxBytesInFlight,
- "In flight data size threshold exceeded %s > %s",
- inFlightBytesCounter.sum(),
- maxBytesInFlight);
+ long size = uploadTask.getSize();
+ uploadThrottle.seizeCapacity(size);
synchronized (scheduled) {
- long size = uploadTask.getSize();
- inFlightBytesCounter.add(size);
scheduledBytesCounter += size;
- scheduled.add(wrapWithSizeUpdate(uploadTask, size,
inFlightBytesCounter));
+ scheduled.add(wrapWithSizeUpdate(uploadTask, size,
uploadThrottle));
scheduleUploadIfNeeded();
}
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
Review comment:
No, I actually mean `interrupt()` to restore interrupt status (since
`InterruptedException` is caught and wrappen, and caller might not check the
cause but might check the status).
##########
File path:
flink-dstl/flink-dstl-dfs/src/main/java/org/apache/flink/changelog/fs/BatchingStateChangeUploader.java
##########
@@ -121,18 +127,17 @@ public void upload(UploadTask uploadTask) {
}
LOG.debug("persist {} changeSets", uploadTask.changeSets.size());
try {
- checkState(
- inFlightBytesCounter.sum() <= maxBytesInFlight,
- "In flight data size threshold exceeded %s > %s",
- inFlightBytesCounter.sum(),
- maxBytesInFlight);
+ long size = uploadTask.getSize();
+ uploadThrottle.seizeCapacity(size);
synchronized (scheduled) {
- long size = uploadTask.getSize();
- inFlightBytesCounter.add(size);
scheduledBytesCounter += size;
- scheduled.add(wrapWithSizeUpdate(uploadTask, size,
inFlightBytesCounter));
+ scheduled.add(wrapWithSizeUpdate(uploadTask, size,
uploadThrottle));
scheduleUploadIfNeeded();
}
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
Review comment:
No, I actually mean `interrupt()` to restore interrupt status (since
`InterruptedException` is caught and wrappen, and caller might not check the
cause but might check the status).
--
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]