Skip to content

Commit

Permalink
fix(Gorgone): fix proxy eating 100% cpu
Browse files Browse the repository at this point in the history
Refs:MON-130747
  • Loading branch information
Evan-Adam committed Aug 5, 2024
1 parent 24c865c commit 9d9e4b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gorgone/gorgone/modules/core/proxy/class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,9 @@ sub event {

my $socket;
if (defined($options{channel})) {
#$self->{logger}->writeLogDebug("[proxy] event channel $options{channel} delete: $self->{clients}->{ $options{channel} }->{delete} com_read_internal: $self->{clients}->{ $options{channel} }->{com_read_internal}")
# if (defined($self->{clients}->{ $options{channel} }));
if (defined($self->{clients}->{ $options{channel} })) {
$self->{logger}->writeLogDebug("[proxy] event channel $options{channel} delete: $self->{clients}->{ $options{channel} }->{delete} com_read_internal: $self->{clients}->{ $options{channel} }->{com_read_internal}");
}
return if (defined($self->{clients}->{ $options{channel} })
&& ( $self->{clients}->{ $options{channel} }->{com_read_internal} == 0
|| $self->{clients}->{ $options{channel} }->{delete} == 1)
Expand Down Expand Up @@ -507,6 +508,11 @@ sub periodic_exec {
$connector->{clients}->{$_}->{class}->close();
$connector->{clients}->{$_}->{class}->cleanup();
}
# if the connection to the node is not established, we stop listenning for new event for this destination,
# so event will be stored in zmq buffer until we start processng them again (see proxy_addnode)
# zmq queue have a limit in size (high water mark), so if the node never connect we will loose some message,
# stoping us from memory leak or other nasty problem.
delete $connector->{watchers}->{$_};
$connector->{clients}->{$_}->{class} = undef;
$connector->{clients}->{$_}->{delete} = 0;
$connector->{clients}->{$_}->{com_read_internal} = 0;
Expand Down

0 comments on commit 9d9e4b4

Please sign in to comment.