Skip to the content.

RFC 0010: Reliable Runtime Restart on Teardown

Summary

Fix rtm.refresh() to always restart the runtime container when there are remaining projects, ensuring redeployed code gets picked up.

Problem

If project A and B share a runtime, tearing down A leaves the container running for B. Redeploying A writes new files but the container never restarts, so old cached code keeps running. The container only restarts when the LAST project is torn down.

Files to Modify

Implementation

  1. In refresh(), after removing a project and finding there are still remaining projects:
    • Log a warning that a restart is needed to pick up changes
    • Restart the container anyway (not just when the last project is removed)
    • On restart, all remaining projects get re-imported
  2. Add a force_restart parameter to refresh() that can be called from the deploy endpoint
  3. After restart, run health check (RFC 0009) to verify all remaining projects are still serving
  4. Add a brief grace period: stop accepting new requests, drain in-flight requests, then restart

Testing & Validation Requirements

Report Requirements