Skip to content

Conversation

@ali-behjati
Copy link
Collaborator

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.

@ali-behjati ali-behjati requested a review from Reisen February 23, 2024 18:48
self.update_our_prices(&publish_keypair.pubkey());

debug!(self.logger, "Exporter: filtering prices permissioned to us";
"our_prices" => format!("{:?}", self.our_prices),
Copy link
Collaborator Author

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),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Ok(()) => {}
Err(_e) => {
warn!(logger, "remote_keypair_loader: Could not send back secondary keypair to channel";
);
Copy link
Contributor

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

Copy link
Contributor

@guibescos guibescos left a 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.
@ali-behjati ali-behjati merged commit 670c080 into main Feb 25, 2024
@ali-behjati ali-behjati deleted the fix/deadlock branch February 25, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants