Skip to content

Conversation

@jcalcote
Copy link

This change adds a withConnectTimeout method to the OncRpcClientBuilder, which populates two fields:

long connectTimeout;
TimeUnit connectTimeoutUnit;

These fields are then passed into the OncRpcClient during build and stored there as final fields on the OncRpcClient. When connect() is called, these values are used. They default to the same values that connect() originally used - Long.MAX_VALUE, and TimeUnit.MILLISECONDS.

This change allows generated interfaces to use a user-specified connect timeout, defaulting to the original default values if not specified. Note the rpcgen code did not need to be modified for this, as it continues to use rpcClient.connect(), but internally, this method uses the builder-specified default values, or the original default values if no builder was used.

An additional constructor is added to facilitate passing the default connect timeout parameters, which makes it possible for non-builder-users to also specify the default connect timeout (though they may also pass those values to connect directly).

This change should be 100% backward compatible. Please also merge to 3.3, if you have nothing against doing so.

Signed-off-by: John Calcote [email protected]

…RpcClient connect call.

Signed-off-by: John Calcote <[email protected]>
@kofemann kofemann merged commit 6055e59 into dCache:master Jul 17, 2025
1 check passed
@kofemann
Copy link
Member

@jcalcote Thanks for the contribution.

@jcalcote jcalcote deleted the feature/m/specify-connect-timeout-in-client-builder branch July 17, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants