Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ledger-api-client] - Do not account for deduplication_time as timeout [KVL-1172] #11791

Merged
merged 4 commits into from
Nov 19, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

package com.daml.ledger.client.services.commands.tracker

import java.time.{Duration, Instant}

import akka.stream.stage._
import akka.stream.{Attributes, Inlet, Outlet}
import com.daml.grpc.{GrpcException, GrpcStatus}
import com.daml.ledger.api.v1.commands.Commands
import com.daml.ledger.api.v1.command_completion_service.Checkpoint
import com.daml.ledger.api.v1.completion.Completion
import com.daml.ledger.api.v1.ledger_offset.LedgerOffset
import com.daml.ledger.client.services.commands.tracker.CommandTracker._
Expand All @@ -24,9 +26,6 @@ import com.google.protobuf.empty.Empty
import com.google.rpc.status.{Status => StatusProto}
import io.grpc.Status
import org.slf4j.LoggerFactory
import java.time.{Duration, Instant}

import com.daml.ledger.api.v1.command_completion_service.Checkpoint

import scala.annotation.nowarn
import scala.collection.compat._
Expand Down Expand Up @@ -255,22 +254,8 @@ private[commands] class CommandTracker[Context](
) with NoStackTrace
}
val commandTimeout = submission.value.timeout match {
// The command submission timeout takes precedence.
case Some(timeout) => durationOrdering.min(timeout, maximumCommandTimeout)
case None =>
commands.deduplicationPeriod match {
// We keep supporting the `deduplication_time` field as the command timeout,
// for historical reasons.
case Commands.DeduplicationPeriod.DeduplicationTime(deduplicationTimeProto) =>
val deduplicationTime = Duration.ofSeconds(
deduplicationTimeProto.seconds,
deduplicationTimeProto.nanos.toLong,
)
durationOrdering.min(deduplicationTime, maximumCommandTimeout)
// All other deduplication periods do not influence the command timeout.
case _ =>
maximumCommandTimeout
}
case None => maximumCommandTimeout
}
val trackingData = TrackingData(
commandId = commandId,
Expand Down