temporalio / sdk-php

Temporal PHP SDK
https://php.preview.thundergun.io
MIT License
270 stars 45 forks source link

[Feature Request] Add RpcRetryOption and use longer retry interval on RESOURCE_EXHAUSTED #421

Closed roxblnfk closed 4 months ago

roxblnfk commented 5 months ago

Currently, in client calls, we pass Retry Policy settings using the \Temporal\Common\RetryOptions DTO, which is also used in $workflowOptions->withRetryOptions().

In the JAVA SDK for client calls (at the RPC level), a separated DTO RpcRetryOption is used, which has specific additional settings.

I suggest doing similarly: add an RpcRetryOption DTO, which will include a new option CongestionInitialInterval, affecting how RESOURCE_EXHAUSTED errors are handled. An option for Jitter could also be added (see https://github.com/temporalio/sdk-java/pull/1465)

To ensure backward compatibility, initially, RpcRetryOption could inherit from RetryOptions.