Skip to content

Commit d4d6936

Browse files
committed
ft-orchestration smaller timeout and ft-analyzer fix debugging
1 parent 5e2ae77 commit d4d6936

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tools/ft-analyzer/ftanalyzer/common/pandas_multiprocessing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
"""
99

1010
import logging
11+
import sys
1112
import time
1213
import os
14+
import pandas as pd
1315
from functools import partial
1416
from typing import Callable, List
15-
import concurrent.futures
17+
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
1618

17-
import pandas as pd
19+
EXECUTOR_CLS = ThreadPoolExecutor if sys.gettrace() is not None else ProcessPoolExecutor
1820

1921
# Max processes to create in multiprocessing pool.
2022
# It helps to reduce RAM usage. For example,
@@ -37,7 +39,7 @@ def __enter__(self):
3739
proc_count = os.cpu_count()
3840
proc_count = int(min(proc_count, MAX_PROC_COUNT))
3941
logging.getLogger().debug("Setting up pool with %d processes.", proc_count)
40-
self._pool = concurrent.futures.ProcessPoolExecutor(max_workers=proc_count)
42+
self._pool = EXECUTOR_CLS(max_workers=proc_count)
4143
self._number_of_chunks = proc_count * 4
4244
return self
4345

tools/ft-orchestration/src/probe/manual.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def stop(self):
7373
return
7474

7575
logging.warning("you can stop the probe now")
76-
wait_time = max(self._timeouts)
76+
wait_time = self._timeouts[1] # inactive timeout is enough
7777
for i in range(wait_time, -1, -1):
7878
logging.info(i)
7979
time.sleep(1)

0 commit comments

Comments
 (0)