The previous implementation redirected sys.stderr to /dev/null using a context manager. This is not thread-safe: 8 concurrent scanner threads each mutate sys.stderr, and when one thread's context manager closes the devnull file, another thread that captured devnull as its saved stderr attempts to write to the closed fd and raises "I/O operation on closed file". This corrupted sys.stderr state caused _fetch_batch_prices to fail and all per-ticker get_stock_price fallback calls to return None, resulting in every candidate being dropped with "no data available". Fix by suppressing at the Python logging level instead of redirecting sys.stderr. Logger.setLevel() is protected by internal locks and is safe to call from concurrent threads. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| agents | ||
| dataflows | ||
| graph | ||
| ml | ||
| schemas | ||
| tools | ||
| ui | ||
| utils | ||
| __init__.py | ||
| config.py | ||
| default_config.py | ||