Skip to content

Commit df34a2b

Browse files
committed
Merge PR linkedin#2793 ack-timeout clamp into PR linkedin#2794
2 parents 4930037 + 078eb22 commit df34a2b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

clients/da-vinci-client/src/main/java/com/linkedin/davinci/config/VeniceServerConfig.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,16 @@ public VeniceServerConfig(VeniceProperties serverProperties, Map<String, Map<Str
12821282
serverProperties.getBoolean(SERVER_LEADER_HANDOVER_EMIT_STEPDOWN_STAMP, false);
12831283
this.leaderHandoverConsumeStepDownStamp =
12841284
serverProperties.getBoolean(SERVER_LEADER_HANDOVER_CONSUME_STEPDOWN_STAMP, false);
1285+
/*
1286+
* Clamp to a non-negative value at read time so that the stamp emit path can call
1287+
* CompletableFuture#get(long, TimeUnit) unconditionally without having to defend against a
1288+
* misconfigured negative timeout (which would otherwise either return immediately or, in
1289+
* some JDK versions, throw IllegalArgumentException — neither is desirable in the demotion
1290+
* handler). A zero value still works: get(0, MILLISECONDS) attempts a no-wait poll and
1291+
* times out immediately if the produce hasn't acked, which is the operator's choice.
1292+
*/
12851293
this.leaderHandoverEmitStepDownStampAckTimeoutMs =
1286-
serverProperties.getLong(SERVER_LEADER_HANDOVER_EMIT_STEPDOWN_STAMP_ACK_TIMEOUT_MS, 1000L);
1294+
Math.max(0L, serverProperties.getLong(SERVER_LEADER_HANDOVER_EMIT_STEPDOWN_STAMP_ACK_TIMEOUT_MS, 1000L));
12871295
this.serverIngestionInfoLogLineLimit = serverProperties.getInt(SERVER_INGESTION_INFO_LOG_LINE_LIMIT, 20);
12881296
this.parallelResourceShutdownEnabled =
12891297
serverProperties.getBoolean(SERVER_PARALLEL_RESOURCE_SHUTDOWN_ENABLED, false);

0 commit comments

Comments
 (0)