This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 87f5a6c229be4fbed011b2360abec8c543b7b906
Author: Sebastian Rühl <[email protected]>
AuthorDate: Thu Nov 20 12:01:04 2025 +0100

    fix(plc4go): finally fix hanging shutdown
---
 plc4go/internal/cbus/Connection.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plc4go/internal/cbus/Connection.go 
b/plc4go/internal/cbus/Connection.go
index 34e080290c..0c94af79a9 100644
--- a/plc4go/internal/cbus/Connection.go
+++ b/plc4go/internal/cbus/Connection.go
@@ -272,7 +272,7 @@ func (c *Connection) startSubscriptionHandler() {
                        }
                }()
                salLogger.Debug().Msg("SAL handler started")
-               for c.IsConnected() {
+               for c.IsConnected() && c.messageCodec.IsRunning() {
                        for monitoredSal := range c.messageCodec.monitoredSALs {
                                if monitoredSal == nil {
                                        salLogger.Trace().Msg("monitoredSal 
chan closed")
@@ -312,7 +312,7 @@ func (c *Connection) startSubscriptionHandler() {
                        }
                }()
                mmiLogger.Debug().Msg("default MMI started")
-               for c.IsConnected() {
+               for c.IsConnected() && c.messageCodec.IsRunning() {
                        for calReply := range c.messageCodec.monitoredMMIs {
                                if calReply == nil {
                                        mmiLogger.Trace().Msg("channel closed")

Reply via email to