Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@paolobarbolini
Copy link
Member

@paolobarbolini paolobarbolini commented Oct 9, 2024

This replaces try_smtp! with a more resilient way of handling network errors and correctly shutting down the connection afterwards.

I'm not too happy about how it turned out, so I'm opening as draft. We are not sending QUIT anymore when encountering certain kinds of errors, plus other unclean things in the implementation. Having to send QUIT like we did before also feels expensive in the sync implementation, as we're potentially taking precious time from the thread to slowly close the connection 🤔.

It should fix/improve the situtation reported in https://matrix.to/#/!jZPOAKPWNeZkNemCEi:gitter.im/$hTxrNpVLYWtAM9a2OciwiGDDGDY3LlZKdnA50cHzc8A?via=gitter.im&via=matrix.org&via=0x.badd.cafe / dani-garcia/vaultwarden#4996 (comment).

The modifications on the async transport also make the implementation cancel safe (in a very conservative way), which may help when connection pooling is enabled and used (Vaultwarden does not use connection pooling as of now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant