pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[Function] support storageClient backoffPlicy configure

Open liudezhi2098 opened this issue 3 years ago • 2 comments

Motivation

When create StorageClient, will use backoffPolicy, but the parameter inside is hardcoded, especially when using localrun mode, if the network delay is large, you need to adjust this parameter.

StorageClientSettings settings = StorageClientSettings.newBuilder()
           .serviceUri(stateStorageServiceUrl)
           .enableServerSideRouting(true)
           .clientName("function-" + tableNs)
           // configure a maximum 2 minutes jitter backoff for accessing table service
           .backoffPolicy(Jitter.of(
               Type.EXPONENTIAL,
               100,
               2000,
               60
               stateStorageBackoffPolicyStartMs,
               stateStorageBackoffPolicyMaxMs,
               stateStorageBackoffPolicyLimit
           ))
           .build();

Modifications

provide configurable

 StorageClientSettings settings = StorageClientSettings.newBuilder()
            .serviceUri(stateStorageServiceUrl)
            .enableServerSideRouting(true)
            .clientName("function-" + tableNs)
            // configure a maximum 2 minutes jitter backoff for accessing table service
            .backoffPolicy(Jitter.of(
                Type.EXPONENTIAL,
                stateStorageBackoffPolicyStartMs,
                stateStorageBackoffPolicyMaxMs,
                stateStorageBackoffPolicyLimit
            ))
            .build();

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no )
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: ( no)
  • Anything that affects deployment: (no)

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • [X] no-need-doc

liudezhi2098 avatar Apr 15 '22 10:04 liudezhi2098

The pr had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar May 22 '22 02:05 github-actions[bot]

The pr had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar Jun 21 '22 02:06 github-actions[bot]