Skip to content

Conversation

@rohan-uiuc
Copy link
Contributor

Stop shutting down the shared thread pool in getTopContexts to prevent thread churn and "can't start new thread" errors.

The ThreadPoolExecutorAdapter was being used as a context manager in getTopContexts, which caused its __exit__ method to call shutdown() on the underlying ThreadPoolExecutor after every request. This constant recreation and shutdown of the thread pool under load was identified as the primary cause of the "can't start new thread" error on Railway. This change ensures the shared executor remains long-lived.


Open in Cursor Open in Web

Co-authored-by: rohanmarwaha222 <rohanmarwaha222@gmail.com>
@cursor
Copy link

cursor bot commented Aug 27, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@supabase
Copy link

supabase bot commented Aug 27, 2025

This pull request has been ignored for the connected project twzwfuydgnnjcaopyfdv because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@rohan-uiuc rohan-uiuc marked this pull request as ready for review August 27, 2025 18:12
cursoragent and others added 4 commits August 27, 2025 18:28
Co-authored-by: rohanmarwaha222 <rohanmarwaha222@gmail.com>
…cutor info

Co-authored-by: rohanmarwaha222 <rohanmarwaha222@gmail.com>
Co-authored-by: rohanmarwaha222 <rohanmarwaha222@gmail.com>
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) August 27, 2025 18:58 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) August 28, 2025 19:14 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) August 31, 2025 12:55 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 2, 2025 15:17 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 3, 2025 01:00 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 3, 2025 21:22 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 5, 2025 17:15 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 8, 2025 14:17 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 9, 2025 14:18 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 10, 2025 16:14 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 11, 2025 17:54 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 12, 2025 20:43 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 15, 2025 02:14 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 17, 2025 22:39 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 18, 2025 14:53 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 19, 2025 13:00 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 19, 2025 20:48 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 22, 2025 14:52 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 23, 2025 13:11 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 23, 2025 19:32 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 24, 2025 22:13 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 25, 2025 21:59 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 26, 2025 20:27 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 29, 2025 06:16 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 29, 2025 18:41 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 30, 2025 14:36 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) September 30, 2025 20:05 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) October 1, 2025 15:10 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) October 2, 2025 14:49 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) October 3, 2025 08:18 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) October 6, 2025 06:04 Inactive
@railway-app railway-app bot temporarily deployed to flask (ai-ta-backend / thread monitor) October 23, 2025 22:19 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants