2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 03:44:52 +00:00

fhem.pl/MQTT2_CLIENT.pm: try to avoid & debug endless loop (Forum #111959)

git-svn-id: https://svn.fhem.de/fhem/trunk@28126 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2023-11-05 11:17:59 +00:00
parent 88a00b58f6
commit 9cd5310176
2 changed files with 7 additions and 1 deletions

View File

@ -116,6 +116,10 @@ MQTT2_CLIENT_connect($;$)
if($mc ne -1 && $hash->{nrFailedConnects} >= $mc) { if($mc ne -1 && $hash->{nrFailedConnects} >= $mc) {
Log3 $me, 2, "maxFailedConnects ($mc) reached, no more reconnect attemtps"; Log3 $me, 2, "maxFailedConnects ($mc) reached, no more reconnect attemtps";
delete($readyfnlist{"$me.".$hash->{DeviceName}}); # Source of retry delete($readyfnlist{"$me.".$hash->{DeviceName}}); # Source of retry
if("$me.".$hash->{DeviceName} ne $hash->{_readyKey}) { #111959
Log3 $me, 2, "RFN ERROR: $me.$hash->{DeviceName} ne $hash->{_readyKey}";
delete($readyfnlist{$hash->{_readyKey}});
}
return; return;
} }

View File

@ -846,12 +846,14 @@ while (1) {
next if(!$h); # due to rereadcfg / delete next if(!$h); # due to rereadcfg / delete
next if($h->{NEXT_OPEN} && gettimeofday() < $h->{NEXT_OPEN}); next if($h->{NEXT_OPEN} && gettimeofday() < $h->{NEXT_OPEN});
$h->{_readyKey} = $p; # Endless-Loop-Debugging #111959
if(CallFn($h->{NAME}, "ReadyFn", $h)) { if(CallFn($h->{NAME}, "ReadyFn", $h)) {
if($readyfnlist{$p}) { # delete itself inside ReadyFn if($readyfnlist{$p}) { # delete itself inside ReadyFn
CallFn($h->{NAME}, "ReadFn", $h); CallFn($h->{NAME}, "ReadFn", $h);
} }
} }
delete($h->{_readyKey});
} }
} }