Pipe: throttle prolonged async sink retries#18222
Merged
jt2594838 merged 1 commit intoJul 16, 2026
Merged
Conversation
jt2594838
approved these changes
Jul 16, 2026
jt2594838
pushed a commit
that referenced
this pull request
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The async Pipe sink retry queue could continuously drain and resubmit events when a receiver remained under memory pressure. A receiver returning
PIPE_RECEIVER_TEMPORARY_UNAVAILABLE_EXCEPTIONorWRITE_PROCESS_REJECT(including either code in a sub-status) therefore caused sustained retry traffic and high sender CPU usage.This PR bounds the duration of normal retries and changes prolonged receiver unavailability into a low-frequency probe mode. Retry events are retained throughout the transition; this change throttles retries and does not introduce a retry TTL or data loss policy.
Retry behavior
The behavior is tracked independently for each receiver endpoint:
pipe_sink_subtask_sleep_interval_init_msandpipe_sink_subtask_sleep_interval_max_ms. Serial reservations prevent several queued events from waking and resubmitting to the same receiver at once.pipe_async_sink_retry_max_duration_ms, regular retries stop. One caller may send a probe immediately, and at most one further probe is allowed perpipe_async_sink_retry_probe_interval_ms.PipeSinkWithSchedulingDelay, so the subtask is delayed instead of repeatedly draining the queue.ConcurrentHashMap.computeIfPresentand checks the active failure window so that an older in-flight success cannot erase a newer failure state.Backoff/probe ownership is endpoint-level, while the existing scheduling-delay API is sink/subtask-level. Consequently, if any endpoint is in probe cooldown, retry draining for that sink is delayed. This intentionally applies backpressure to the shared retry queue and prioritizes stopping an overload retry storm over continuing maximum throughput to other endpoints during the cooldown.
Hidden configuration
Two hidden system properties control the transition:
pipe_async_sink_retry_max_duration_ms600000enters probe mode immediately; a negative value disables the transition and retains regular retries indefinitely.pipe_async_sink_retry_probe_interval_ms300001are clamped to1ms.For compatibility with the previous connector naming convention, the parser also accepts
pipe_async_connector_retry_max_duration_msandpipe_async_connector_retry_probe_interval_ms. Thepipe_async_sink_*names take precedence when both are set.These properties are intentionally not added to any
.properties,.conf, or configuration template. They remain internal tuning parameters while the default behavior is enabled for all async Pipe sinks.Async client and error handling
An async client may already have been borrowed when an event discovers that its endpoint is in probe cooldown. In that case the handler now returns the client to the pool before routing the event through
onError, which safely puts the event back into the retry queue. The sliced-request fallback path follows the same ownership rule.The cooldown uses
PipeRuntimeSinkNonReportTimeConfigurableExceptionas an internal scheduling signal.PipeSinkSubtaskpreserves this exception for heartbeat events instead of wrapping it as aPipeConnectionException; this avoids triggering a meaningless handshake while the receiver is deliberately cooling down.Concurrency and edge cases
Long.MAX_VALUEto avoid overflow for large hidden-property values.Verification
iotdb-core/datanodeandiotdb-core/node-commons.PipeTransferTrackableHandlerTestandPipeSinkSubtaskTest; all passed.git diff --check.The normal DataNode Maven test invocation is currently blocked during unrelated full-module compilation by missing symbols such as
IFill,Accumulator, andTopKRuntimeFilter. The focused tests were therefore compiled and run with the Maven-generated test classpath.This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
IoTDBDataRegionAsyncSink: endpoint retry serialization, retry-duration tracking, probe admission, scheduling delay, and recovery.PipeTransferTrackableHandler: async-client ownership and retry-queue handling when a probe is delayed.PipeSinkSubtask: preservation of the non-report scheduling signal on the heartbeat path.CommonConfig,PipeConfig, andPipeDescriptor: hidden defaults, accessors, logging, aliases, and property parsing.