提交 de3b9486 编写于 作者: P Ping Xiao

Merge branch 'develop' into fix-multiple-threads-issue

...@@ -193,7 +193,7 @@ static void* realloc_detect_leak(void* ptr, size_t size, const char* file, uint3 ...@@ -193,7 +193,7 @@ static void* realloc_detect_leak(void* ptr, size_t size, const char* file, uint3
return malloc_detect_leak(size, file, line); return malloc_detect_leak(size, file, line);
} }
SMemBlock* blk = ((char*)ptr) - sizeof(SMemBlock); SMemBlock* blk = (SMemBlock *)((char*)ptr) - sizeof(SMemBlock);
if (blk->magic != MEMBLK_MAGIC) { if (blk->magic != MEMBLK_MAGIC) {
if (fpAllocLog != NULL) { if (fpAllocLog != NULL) {
fprintf(fpAllocLog, "%s:%d: memory is allocated by default allocator.\n", file, line); fprintf(fpAllocLog, "%s:%d: memory is allocated by default allocator.\n", file, line);
......
...@@ -32,6 +32,7 @@ class TDTestCase: ...@@ -32,6 +32,7 @@ class TDTestCase:
tdDnodes.stop(1) tdDnodes.stop(1)
tdDnodes.deploy(1) tdDnodes.deploy(1)
tdDnodes.start(1) tdDnodes.start(1)
tdLog.sleep(5)
tdSql.execute('reset query cache') tdSql.execute('reset query cache')
tdSql.execute('drop database if exists db') tdSql.execute('drop database if exists db')
...@@ -61,6 +62,7 @@ class TDTestCase: ...@@ -61,6 +62,7 @@ class TDTestCase:
tdDnodes.stop(1) tdDnodes.stop(1)
tdLog.sleep(5) tdLog.sleep(5)
tdDnodes.start(1) tdDnodes.start(1)
tdLog.sleep(5)
tdLog.info("================= step5") tdLog.info("================= step5")
tdLog.info("import 10 data totally repetitive") tdLog.info("import 10 data totally repetitive")
......
...@@ -81,7 +81,7 @@ if __name__ == "__main__": ...@@ -81,7 +81,7 @@ if __name__ == "__main__":
else: else:
toBeKilled = "valgrind.bin" toBeKilled = "valgrind.bin"
killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -HUP " % toBeKilled killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -HUP > /dev/null 2>&1" % toBeKilled
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
processID = subprocess.check_output(psCmd, shell=True) processID = subprocess.check_output(psCmd, shell=True)
...@@ -91,8 +91,17 @@ if __name__ == "__main__": ...@@ -91,8 +91,17 @@ if __name__ == "__main__":
time.sleep(1) time.sleep(1)
processID = subprocess.check_output(psCmd, shell=True) processID = subprocess.check_output(psCmd, shell=True)
fuserCmd = "fuser -k -n tcp 6030" for port in range(6030, 6041):
os.system(fuserCmd) usePortPID = "lsof -i tcp:%d | grep LISTEn | awk '{print $2}'" % port
processID = subprocess.check_output(usePortPID, shell=True)
if processID:
killCmd = "kill -9 %s" % processID
os.system(killCmd)
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if valgrind:
time.sleep(2)
tdLog.info('stop All dnodes') tdLog.info('stop All dnodes')
sys.exit(0) sys.exit(0)
......
...@@ -251,11 +251,16 @@ class TDDnode: ...@@ -251,11 +251,16 @@ class TDDnode:
psCmd, shell=True).decode("utf-8") psCmd, shell=True).decode("utf-8")
while(processID): while(processID):
killCmd = "kill -INT %s" % processID killCmd = "kill -INT %s > /dev/null 2>&1" % processID
os.system(killCmd) os.system(killCmd)
time.sleep(1) time.sleep(1)
processID = subprocess.check_output( processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8") psCmd, shell=True).decode("utf-8")
for port in range(6030, 6041):
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if self.valgrind:
time.sleep(2)
self.running = 0 self.running = 0
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index)) tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
...@@ -272,11 +277,16 @@ class TDDnode: ...@@ -272,11 +277,16 @@ class TDDnode:
psCmd, shell=True).decode("utf-8") psCmd, shell=True).decode("utf-8")
while(processID): while(processID):
killCmd = "kill -KILL %s" % processID killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd) os.system(killCmd)
time.sleep(1) time.sleep(1)
processID = subprocess.check_output( processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8") psCmd, shell=True).decode("utf-8")
for port in range(6030, 6041):
fuserCmd = "fuser -k -n tcp %d" % port
os.system(fuserCmd)
if self.valgrind:
time.sleep(2)
self.running = 0 self.running = 0
tdLog.debug("dnode:%d is stopped by kill -KILL" % (self.index)) tdLog.debug("dnode:%d is stopped by kill -KILL" % (self.index))
...@@ -325,7 +335,7 @@ class TDDnodes: ...@@ -325,7 +335,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'" psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8") processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID): while(processID):
killCmd = "kill -KILL %s" % processID killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd) os.system(killCmd)
time.sleep(1) time.sleep(1)
processID = subprocess.check_output( processID = subprocess.check_output(
...@@ -334,7 +344,7 @@ class TDDnodes: ...@@ -334,7 +344,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'" psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8") processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID): while(processID):
killCmd = "kill -KILL %s" % processID killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd) os.system(killCmd)
time.sleep(1) time.sleep(1)
processID = subprocess.check_output( processID = subprocess.check_output(
...@@ -440,7 +450,7 @@ class TDDnodes: ...@@ -440,7 +450,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'" psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8") processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID): while(processID):
killCmd = "kill -KILL %s" % processID killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd) os.system(killCmd)
time.sleep(1) time.sleep(1)
processID = subprocess.check_output( processID = subprocess.check_output(
...@@ -449,7 +459,7 @@ class TDDnodes: ...@@ -449,7 +459,7 @@ class TDDnodes:
psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'" psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID = subprocess.check_output(psCmd, shell=True).decode("utf-8") processID = subprocess.check_output(psCmd, shell=True).decode("utf-8")
while(processID): while(processID):
killCmd = "kill -KILL %s" % processID killCmd = "kill -KILL %s > /dev/null 2>&1" % processID
os.system(killCmd) os.system(killCmd)
time.sleep(1) time.sleep(1)
processID = subprocess.check_output( processID = subprocess.check_output(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册