You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/05/10 07:07:32 UTC

[plc4x] branch develop updated: fix(plc4go/spi): print stack when panic is caught

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


The following commit(s) were added to refs/heads/develop by this push:
     new 3011a3e515 fix(plc4go/spi): print stack when panic is caught
3011a3e515 is described below

commit 3011a3e515ce63273a77da6fcb7a0b7ae8479151
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue May 9 17:45:14 2023 +0200

    fix(plc4go/spi): print stack when panic is caught
---
 plc4go/spi/RequestTransactionManager_test.go | 6 ++++--
 plc4go/spi/utils/WorkerPool.go               | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/plc4go/spi/RequestTransactionManager_test.go b/plc4go/spi/RequestTransactionManager_test.go
index 82b03a269b..9c364221d1 100644
--- a/plc4go/spi/RequestTransactionManager_test.go
+++ b/plc4go/spi/RequestTransactionManager_test.go
@@ -348,10 +348,12 @@ func Test_requestTransactionManager_processWorklog(t *testing.T) {
 				workLog: func() list.List {
 					l := list.New()
 					l.PushBack(&requestTransaction{
-						transactionId: 1,
+						transactionId:    1,
+						completionFuture: NewMockCompletionFuture(t),
 					})
 					l.PushBack(&requestTransaction{
-						transactionId: 2,
+						transactionId:    2,
+						completionFuture: NewMockCompletionFuture(t),
 					})
 					return *l
 				}(),
diff --git a/plc4go/spi/utils/WorkerPool.go b/plc4go/spi/utils/WorkerPool.go
index 86684dd5a5..8576bb7516 100644
--- a/plc4go/spi/utils/WorkerPool.go
+++ b/plc4go/spi/utils/WorkerPool.go
@@ -25,6 +25,7 @@ import (
 	"github.com/pkg/errors"
 	"github.com/rs/zerolog"
 	"github.com/rs/zerolog/log"
+	"runtime/debug"
 	"sync"
 	"sync/atomic"
 	"time"
@@ -53,7 +54,7 @@ func (w *worker) initialize() {
 func (w *worker) work() {
 	defer func() {
 		if recovered := recover(); recovered != nil {
-			log.Error().Msgf("Recovering from panic()=%v", recovered)
+			log.Error().Msgf("Recovering from panic():%v. Stack: %s", recovered, debug.Stack())
 		}
 		if !w.shutdown.Load() {
 			// if we are not in shutdown we continue