|
3 | 3 | // |
4 | 4 |
|
5 | 5 | #include "parallel_convert.h" |
| 6 | +#include "common_util.h" |
6 | 7 |
|
7 | 8 | #include <RoundRobinThreadAffinedTaskScheduler.h> |
8 | 9 | #include <YieldingWaitStrategy.h> |
@@ -75,25 +76,25 @@ void BinlogEventConvertHandler::onEvent(BinlogEvent& binlog_event, std::int64_t |
75 | 76 |
|
76 | 77 | void ConvertExceptionHandler::handleEventException(const std::exception& ex, std::int64_t sequence, BinlogEvent& evt) |
77 | 78 | { |
78 | | - OMS_ERROR("Handle event exception: {},sequence :{}", ex.what(), sequence); |
| 79 | + OMS_ERROR("Handle event exception: {},sequence :{}, trace :{}", ex.what(), sequence, CommonUtils::get_stack_trace()); |
79 | 80 | converter.stop_converter(); |
80 | 81 | } |
81 | 82 |
|
82 | 83 | void ConvertExceptionHandler::handleOnStartException(const std::exception& ex) |
83 | 84 | { |
84 | | - OMS_ERROR("Handle event exception: {},sequence :{}", ex.what()); |
| 85 | + OMS_ERROR("Handle event exception: {},sequence :{}, trace :{}", ex.what(), CommonUtils::get_stack_trace()); |
85 | 86 | converter.stop_converter(); |
86 | 87 | } |
87 | 88 |
|
88 | 89 | void ConvertExceptionHandler::handleOnShutdownException(const std::exception& ex) |
89 | 90 | { |
90 | | - OMS_ERROR("Handle event exception: {},sequence :{}", ex.what()); |
| 91 | + OMS_ERROR("Handle event exception: {},sequence :{}, trace :{}", ex.what(), CommonUtils::get_stack_trace()); |
91 | 92 | converter.stop_converter(); |
92 | 93 | } |
93 | 94 |
|
94 | 95 | void ConvertExceptionHandler::handleOnTimeoutException(const std::exception& ex, std::int64_t sequence) |
95 | 96 | { |
96 | | - OMS_ERROR("Handle event exception: {},sequence :{}", ex.what(), sequence); |
| 97 | + OMS_ERROR("Handle event exception: {},sequence :{}, trace :{}", ex.what(), sequence, CommonUtils::get_stack_trace()); |
97 | 98 | converter.stop_converter(); |
98 | 99 | } |
99 | 100 |
|
@@ -650,7 +651,9 @@ int ParallelConvert::init(IObCdcAccess* obcdc) |
650 | 651 | } |
651 | 652 | void ParallelConvert::stop() |
652 | 653 | { |
653 | | - _disruptor->shutdown(); |
| 654 | + // Fix dima: 2025010800106932017 |
| 655 | + // If all converter threads exit at the same time, the records in the ringbuffer will never bee handled. |
| 656 | + _disruptor->shutdown(std::chrono::milliseconds(60 * 1000)); |
654 | 657 | _task_scheduler->stop(); |
655 | 658 | Thread::stop(); |
656 | 659 | } |
|
0 commit comments