Skip to content

Conversation

@MelkorBalrog
Copy link
Owner

Summary

  • Reintroduce a threaded service manager and expose it through the services package
  • Register memory manager and application launch with the global thread manager for unified supervision
  • Bump project version to 0.2.208 and document thread-managed services in history

Testing

  • radon cc -j AutoML.py tools/memory_manager.py mainappsrc/services/service_manager.py tests/test_launcher_threading.py tests/test_thread_manager.py
  • pytest tests/services/test_service_manager.py tests/test_launcher_threading.py tests/test_thread_manager.py -q
  • pytest --maxfail=1 -q

https://chatgpt.com/codex/tasks/task_b_68b1b3ed48f88327ae3920fefe4e8025

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +303 to +304
thread = thread_manager.register("main_app", module.main, daemon=False)
thread.join()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Unregister main thread before ThreadManager can respawn it

The new main() flow registers the application’s entry point with thread_manager and only calls thread_manager.unregister("main_app") after joining the returned thread. ThreadManager automatically restarts any registered thread that terminates, so there is a race: if module.main returns or raises and the monitor runs before unregister executes, a fresh non-daemon thread is spawned. The join waits only for the original thread, while the replacement thread continues running unjoined and may block process shutdown or execute module.main twice. To avoid this, unregister (and join the returned thread) before the monitor can respawn the worker, or otherwise disable auto-restart for this one-shot task.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant