[FIXED] Gateway RS+/- blocks on account fetch#7449
Conversation
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
2e7c876 to
c54d016
Compare
|
I originally included this comment in the PR description:
Have updated the test to include Not fetching the account in the gateway's And, I've tested this condition as well where a server gets the RS+ over a gateway for an account that it doesn't know and then also doesn't fetch. When adding a leaf node connection to this server it itself will do the account fetching, which will be run in the client's |
The methods
processGatewayRSubandprocessGatewayRUnsubcan call intoupdateInterestForAccountOnGateway, which in turn callss.LookupAccount. If the account is not known it will be fetched if there's an account resolver. But, since this is done while in the read loop of the gateway, this blocks not only receiving the response for the account fetch (when using a NATS resolver) but also any other operation like PING/PONG, which then could lead to a stale connection.The fix proposed by this PR is to not allow fetching the account inline of the gateway read loop.
Signed-off-by: Maurice van Veen github@mauricevanveen.com