Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wait() method to block until Sidecar is up #287

Closed
noahziheng opened this issue May 14, 2022 · 1 comment · Fixed by #329 or wXwcoder/go-sdk#1
Closed

Add wait() method to block until Sidecar is up #287

noahziheng opened this issue May 14, 2022 · 1 comment · Fixed by #329 or wXwcoder/go-sdk#1
Assignees
Labels
enhancement New feature or request

Comments

@noahziheng
Copy link

noahziheng commented May 14, 2022

Is your feature request related to a problem? Please describe.

App might depend on sidecar right away. Implement wait() method to enable app to wait for sidecar to be up before invoking the first call.

Describe the solution you'd like

  1. Implement WaitForSidecar method to block NewClient until Dapr sidecar is ready.
  2. Maybe we can allow user set context.WithTimeout timeout duration to solve this issue.

Additional context

This issue is created on dapr/dapr: dapr/dapr#1933

And other language has implemented this feature:

@noahziheng noahziheng added the enhancement New feature or request label May 14, 2022
@tmacam
Copy link
Contributor

tmacam commented Oct 14, 2022

/assign

tmacam added a commit to tmacam/dapr-go-sdk that referenced this issue Oct 18, 2022
App might depend on sidecar right away. This PR adds a Wait() method to
enable app to wait for sidecar to be up before invoking the first call.

GRPC client creation on Dapr Go SDK is blocking, so waiting for client
readiness  is less of a problem here than on SDKs where client
connection establishment is async.

Closes dapr#287
tmacam added a commit to tmacam/dapr-go-sdk that referenced this issue Oct 18, 2022
App might depend on sidecar right away. This PR adds a Wait() method to
enable app to wait for sidecar to be up before invoking the first call.

GRPC client creation on Dapr Go SDK is blocking, so waiting for client
readiness  is less of a problem here than on SDKs where client
connection establishment is async.

Closes dapr#287

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
yaron2 pushed a commit that referenced this issue Nov 2, 2022
* Add wait() method to block until Sidecar is up.

App might depend on sidecar right away. This PR adds a Wait() method to
enable app to wait for sidecar to be up before invoking the first call.

GRPC client creation on Dapr Go SDK is blocking, so waiting for client
readiness  is less of a problem here than on SDKs where client
connection establishment is async.

Closes #287

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Move Wait its own file.

If anything, this will make testing and the change more localized.

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Adding unresponsive TCP and Unix servers and tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove comments, clean code up

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove a bit of code duplication on tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fix Wait and test server setup.

* Multiple state changes can happen for a single GRPC Connection.
  previous code assume a single one and was failing miserably. Fixed.
* The logic for the test server's tear down was lacking. Fixed

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Rename on aux. method

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Add link to gRPC documentation about connectivity semantics

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing more lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
mikeb26 pushed a commit to bopmatic/dapr-go-sdk that referenced this issue Nov 13, 2022
* Add wait() method to block until Sidecar is up.

App might depend on sidecar right away. This PR adds a Wait() method to
enable app to wait for sidecar to be up before invoking the first call.

GRPC client creation on Dapr Go SDK is blocking, so waiting for client
readiness  is less of a problem here than on SDKs where client
connection establishment is async.

Closes dapr#287

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Move Wait its own file.

If anything, this will make testing and the change more localized.

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Adding unresponsive TCP and Unix servers and tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove comments, clean code up

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove a bit of code duplication on tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fix Wait and test server setup.

* Multiple state changes can happen for a single GRPC Connection.
  previous code assume a single one and was failing miserably. Fixed.
* The logic for the test server's tear down was lacking. Fixed

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Rename on aux. method

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Add link to gRPC documentation about connectivity semantics

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing more lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
(cherry picked from commit c2dfec6)
wXwcoder pushed a commit to wXwcoder/go-sdk that referenced this issue Nov 14, 2022
* Add wait() method to block until Sidecar is up.

App might depend on sidecar right away. This PR adds a Wait() method to
enable app to wait for sidecar to be up before invoking the first call.

GRPC client creation on Dapr Go SDK is blocking, so waiting for client
readiness  is less of a problem here than on SDKs where client
connection establishment is async.

Closes dapr#287

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Move Wait its own file.

If anything, this will make testing and the change more localized.

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Adding unresponsive TCP and Unix servers and tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove comments, clean code up

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Remove a bit of code duplication on tests

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fix Wait and test server setup.

* Multiple state changes can happen for a single GRPC Connection.
  previous code assume a single one and was failing miserably. Fixed.
* The logic for the test server's tear down was lacking. Fixed

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Rename on aux. method

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Add link to gRPC documentation about connectivity semantics

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

* Fixing more lint errors

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>

Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
Signed-off-by: wangxw <996268132@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants