Tonic: 0.3.0 Client::connect always returns Ok even if the sever URL does not exist.

Created on 16 Jul 2020  ·  12Comments  ·  Source: hyperium/tonic

Bug Report

Version 0.3.0

Platform

tonic-client-bug v0.1.0 (/tmp/tonic-0.3.0-client-bug)
└── tonic v0.3.0
└── tonic-build v0.2.0

Crates

tonic = { version = "0.3.0", features = ["tls"] }
prost = "0.6.1"
tokio = { version = "0.2.21", features = ["full"] }
futures = "0.3.5"
async-stream = "0.2.1"

Description


I excepted that the client returns an Err if no connection to the sever could establish.
Example Repository: https://github.com/DominicWrege/tonic-0.3.0-client-bug

bug crattonic

Most helpful comment

I experienced the same behavior, thank you for taking the time to fix this <3

All 12 comments

I wonder if it is related to https://github.com/hyperium/tonic/pull/392, will have to take a look later this week. Thanks for opening the issue :)

Thanks for your response. So the basically connect is the new lazy_connect ? Or did I misunderstood something?
I my opinion it should be very explicated if the connection should be established lazy or not.
My problem is that I want to check if the server is available by simply trying if a can get a connection.

@DominicWrege no I mean't that that change may have introduced unexpected behavior.

I experienced the same behavior, thank you for taking the time to fix this <3

@DominicWrege this should fix it https://github.com/hyperium/tonic/pull/413, I wrote a small description in the PR for why it was happening.

thx

Thank you ! works like a charm !

Will there be a 0.3.1 (or similar) release with this fix soon? We are currently holding off upgrading from 0.2 due to this issue.

@faern should be out in the next 10min https://github.com/hyperium/tonic/pull/436

Ok, 0.3.1 is out.

Awesome! Thank you for this incredible response time!

We like our low p99s 😉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthauck picture matthauck  ·  6Comments

mariogemoll picture mariogemoll  ·  4Comments

frol picture frol  ·  7Comments

jen20 picture jen20  ·  6Comments

petratbtl picture petratbtl  ·  7Comments