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?
Will the (synchronous) Command Service timeout a command if for example the completion is lost? If yes:
CommandService
returns with an error ABORTED
for tracked commands without a result from the ledger within the deduplication window.24h
.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?
Thanks,
Daniel
/**
* @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))
}
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
as shown in code below
val commandClient: CommandClient =
new CommandClient(
LedgerClient.stub(CommandSubmissionServiceGrpc.stub(channel), config.token),
LedgerClient.stub(CommandCompletionServiceGrpc.stub(channel), config.token),
ledgerId,
config.applicationId,
config.commandClient
)
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
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