Closed jakajancar closed 1 year ago
The general expectation is that errors returned from poll_message are fatal and it shouldn't be called again. I can update the documentation to make that more clear.
👍🏻 So None
is expected only for graceful disconnect?
Also, out of curiosity, is there a reason for not just implementing Stream
?
👍🏻 So
None
is expected only for graceful disconnect?
Yep
Also, out of curiosity, is there a reason for not just implementing
Stream
?
There's a lot of method name overlap between FutureExt and StreamExt, and the connection type already implements Future. Having both impls would prevent those combinators from being callable cleanly if both traits were in scope.
Good point, thanks!
Hey,
I'm not sure whether to be impressed or scared. My application (using tokio-postgres) started producing ~125k errors per second (and incurred $800 of AWS CloudWatch Logs costs). The specific error was:
This is coming from here:
I suspect the reason is that
poll_message
callspoll_shutdown
, which callsFramed/Sink::poll_close
, which returnsErr
. According to the documentation ofSink
, "If this function encounters an error, the sink should be considered to have failed permanently, and no more Sink methods should be called.", however, tokio-postgres does not remember this and keeps calling it.Or perhaps this is expected and I should stop reading after
Err
is returned, in which case it would be nice to explicitly document this. Because of theOption
and the semantics of a stream, I assumed the interface wasStream
-y and terminates afterNone
is returned.