fix(tmq): revoke the fix, it will definitly cause the deadlock.

This commit is contained in:
Haojun Liao 2023-04-24 09:50:39 +08:00
parent 134c0528ae
commit 7e9432606d
2 changed files with 6 additions and 5 deletions

View File

@ -170,7 +170,7 @@ class TMQCom:
if tdSql.getData(i, 1) == 1:
loopFlag = 0
break
time.sleep(0.02)
time.sleep(0.10)
return
def create_database(self,tsql, dbName,dropFlag=1,vgroups=4,replica=1):

View File

@ -690,12 +690,11 @@ int32_t notifyMainScript(SThreadInfo* pInfo, int32_t cmdId) {
}
static int32_t g_once_commit_flag = 0;
static int32_t g_once_consume_flag = 0;
static void tmq_commit_cb_print(tmq_t* tmq, int32_t code, void* param) {
taosFprintfFile(g_fp, "tmq_commit_cb_print() commit %d\n", code);
if (g_once_consume_flag == 1 && 0 == g_once_commit_flag) {
if (0 == g_once_commit_flag) {
g_once_commit_flag = 1;
notifyMainScript((SThreadInfo*)param, (int32_t)NOTIFY_CMD_START_COMMIT);
}
@ -774,6 +773,8 @@ int32_t saveConsumeResult(SThreadInfo* pInfo) {
void loop_consume(SThreadInfo* pInfo) {
int32_t code;
int32_t once_flag = 0;
int64_t totalMsgs = 0;
int64_t totalRows = 0;
@ -833,8 +834,8 @@ void loop_consume(SThreadInfo* pInfo) {
lastTotalMsgs = totalMsgs;
}
if (0 == g_once_consume_flag) {
g_once_consume_flag = 1;
if (0 == once_flag) {
once_flag = 1;
notifyMainScript(pInfo, NOTIFY_CMD_START_CONSUM);
}