-
Notifications
You must be signed in to change notification settings - Fork 20
fix: remove adapter <> api deadlock #108
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
Conversation
| self.update_our_prices(&publish_keypair.pubkey()); | ||
|
|
||
| debug!(self.logger, "Exporter: filtering prices permissioned to us"; | ||
| "our_prices" => format!("{:?}", self.our_prices), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this log is so huge and not very useful.
| trace!( | ||
| self.logger, | ||
| "Exporter: No more permissioned price accounts in channel, using cached value"; | ||
| "cached_value" => format!("{:?}", self.our_prices), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
cbd862c to
47185bc
Compare
| Ok(()) => {} | ||
| Err(_e) => { | ||
| warn!(logger, "remote_keypair_loader: Could not send back secondary keypair to channel"; | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol what was this styling
guibescos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Adapter sends price update notifications to the subscriber API connection actor but at the same time the subscriber actor can get blcoked on receiving messages (e.g. product info) from Adapter. If the channel from Adapter to the subscriber gets full the Adapter can get blocked and this results in a deadlock. This situation propagates and queues messages in other actors and WS messages from the clients will grow in an unbounded queue that results in a constant memory growth (leak). This change simply makes the Adaptor to subscriber API connection nonblocking by dropping messages if the channels are full.
47185bc to
56b803d
Compare
Adapter sends price update notifications to the subscriber API connection actor but at the same time the subscriber actor can get blcoked on receiving messages (e.g. product info) from Adapter. If the channel from Adapter to the subscriber gets full the Adapter can get blocked and this results in a deadlock. This situation propagates and queues messages in other actors and WS messages from the clients will grow in an unbounded queue that results in a constant memory growth (leak).
This change simply makes the Adaptor to subscriber API connection nonblocking by dropping messages if the channels are full.