go-sdk icon indicating copy to clipboard operation
go-sdk copied to clipboard

Adds new `NewClientWithAddressContextNoEnvTimeout` func

Open JoshVanL opened this issue 1 year ago • 6 comments

As an app developer I do not want to have a default of 5 seconds timeout for connecting to daprd, and don't wish to use environment variables to configure this value. Instead, I would like to solely rely on the context I pass to the client New func.

Adds new NewClientWithAddressContextNoEnvTimeout func to create clientwhich ignores the DAPR_CLIENT_TIMEOUT_SECONDS env var.

JoshVanL avatar Aug 16 '23 22:08 JoshVanL

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4afb831) 70.00% compared to head (9e6b273) 70.04%. Report is 22 commits behind head on main.

:exclamation: Current head 9e6b273 differs from pull request most recent head 54abb81. Consider uploading reports for the commit 54abb81 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #437      +/-   ##
==========================================
+ Coverage   70.00%   70.04%   +0.04%     
==========================================
  Files          33       33              
  Lines        2667     2671       +4     
==========================================
+ Hits         1867     1871       +4     
  Misses        698      698              
  Partials      102      102              
Files Coverage Δ
client/client.go 70.73% <100.00%> (+0.98%) :arrow_up:

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 16 '23 22:08 codecov[bot]

Another options is to have the env var override the timeout for the context (if possible).

artursouza avatar Aug 16 '23 22:08 artursouza

I'd be happy to have the default to be no timeout if we don't consider that a breaking change.

JoshVanL avatar Aug 16 '23 22:08 JoshVanL

It is a breaking change. Yaron would need to accept that as a maintainer here. I am not.

On Wed, Aug 16, 2023 at 3:31 PM Josh van Leeuwen @.***> wrote:

I'd be happy to have the default to be no timeout if we don't consider that a breaking change.

— Reply to this email directly, view it on GitHub https://github.com/dapr/go-sdk/pull/437#issuecomment-1681350591, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA77CT33CYL5O5FBKHYUZ3XVVC2RANCNFSM6AAAAAA3TE7Q5E . You are receiving this because you commented.Message ID: @.***>

artursouza avatar Aug 16 '23 22:08 artursouza

I have knowledge of Go-SDK users that rely on the default 5s timeout for various reasons, so I recommend to not change the default.

yaron2 avatar Aug 17 '23 22:08 yaron2

ping @JoshVanL

daixiang0 avatar Nov 06 '23 01:11 daixiang0