Command service timeout

Will the (synchronous) Command Service timeout a command if for example the completion is lost? If yes:

  • What will the service return to the synchronous client call?
  • What is the default timeout set?
  • Can this be configured?
  • The CommandService returns with an error ABORTED for tracked commands without a result from the ledger within the deduplication window.
  • The default deduplication window is 24h.
  • This window can be customized for each request via the Commands#deduplication_time field.

HI @gerolf ,

Thanks for the explanation. I was looking for similar info.

One question though:
We are using ledger-api-client, per the source code, how is the defaultDeduplicationTime 30s (see below) differs to the 24h you mentioned above?


  * @param maxCommandsInFlight The maximum number of unconfirmed commands the client may track.
  *                            The client will backpressure when this number is reached.
  * @param maxParallelSubmissions The maximum number of parallel command submissions at a given time.
  *                               The client will backpressure when this number is reached.
  * @param defaultDeduplicationTime The deduplication time to use for commands that do not have
  *                                 a deduplication time set. The deduplication time is also used
  *                                 as the time after which commands time out in the command client.
final case class CommandClientConfiguration(
    maxCommandsInFlight: Int,
    maxParallelSubmissions: Int,
    defaultDeduplicationTime: Duration,

object CommandClientConfiguration {
  def default = CommandClientConfiguration(1, 1, Duration.ofSeconds(30L))
1 Like

The 24h default value on the Ledger is only used if the client doesn’t set a deduplication time. In this case, the client sets this parameter to 30s, so this is what will be used.


Thanks @gerolf.

So I studied the code a bit more. Is it correct to say that there are two kind of command client (provided in the ledger-api-client..jar

  1. commandClient
  2. synchrounousCommandClient

as shown in code below

  val commandClient: CommandClient =
    new CommandClient(
      LedgerClient.stub(CommandSubmissionServiceGrpc.stub(channel), config.token),
      LedgerClient.stub(CommandCompletionServiceGrpc.stub(channel), config.token),

  val commandServiceClient: SynchronousCommandClient =
    new SynchronousCommandClient(LedgerClient.stub(CommandServiceGrpc.stub(channel), config.token))

The config referenced about (Command service timeout) is applicabel tot he commandClient

where if I were using the commandServiceClient: SynchronousCommandClient
then two kind of deduplication can be configured

  1. dedup specifed in Commands (
  2. otherwise, default value (e.g. 24 hour as you mentioned)
    In this case, the defaultDeduplicationTime as specified on the CommandClientConfiguration is irrelevant?

CommandClient in the code snippet above basically does what the CommandService does on the Ledger API Server.

Your statements about SynchronousCommandClient are correct :+1: