Skip to content

Commit 1ef36bd

Browse files
committed
feat(flow):1.12.20, 在StateMachine打印递归调用警告时将调用栈也打印出来,以便排查
1 parent d8d7ade commit 1ef36bd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

modules/flow/state_machine.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <tbox/base/log.h>
2828
#include <tbox/base/assert.h>
2929
#include <tbox/base/json.hpp>
30+
#include <tbox/base/backtrace.h>
3031

3132
namespace tbox {
3233
namespace flow {
@@ -340,7 +341,7 @@ bool StateMachine::Impl::start()
340341
}
341342

342343
if (cb_level_ != 0) {
343-
LogWarn("[%s]: recursion invoke", name_.c_str());
344+
LogWarn("[%s]: recursion invoke, call stack:\n%s", name_.c_str(), DumpBacktrace().c_str());
344345
return false;
345346
}
346347

@@ -371,7 +372,7 @@ void StateMachine::Impl::stop()
371372
return;
372373

373374
if (cb_level_ != 0) {
374-
LogWarn("[%s]: recursion invoke", name_.c_str());
375+
LogWarn("[%s]: recursion invoke, call stack:\n%s", name_.c_str(), DumpBacktrace().c_str());
375376
return;
376377
}
377378

@@ -392,7 +393,7 @@ bool StateMachine::Impl::run(Event event)
392393
}
393394

394395
if (cb_level_ != 0) {
395-
LogWarn("[%s]: recursion invoke", name_.c_str());
396+
LogWarn("[%s]: recursion invoke, call stack:\n%s", name_.c_str(), DumpBacktrace().c_str());
396397
return false;
397398
}
398399

version.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
# TBOX版本号
2222
TBOX_VERSION_MAJOR := 1
2323
TBOX_VERSION_MINOR := 12
24-
TBOX_VERSION_REVISION := 19
24+
TBOX_VERSION_REVISION := 20

0 commit comments

Comments
 (0)