Orchestrator teardown timeout (5 s) is too short, causing spurious teardown warnings on macOS #435
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When a macOS bot-bottle session closes,
teardown_consolidatedissues aDELETE /bottles/{id}against the orchestrator control plane. The request usesOrchestratorClient's hard-codedDEFAULT_TIMEOUT_SECONDS = 5.0, which is too short — on a slow or momentarily loaded host the request times out, raising anOrchestratorClientError:teardown()inlaunch.pycatches the exception, logs the warning, revokes deploy keys (which succeeds), then re-raises — producing a full Python traceback even though the session otherwise completed cleanly.The same code path exists in the docker and firecracker backends (
backend/docker/consolidated_launch.py:149,backend/firecracker/consolidated_launch.py:99).Fix
Make the teardown timeout configurable via a priority chain:
BOT_BOTTLE_ORCHESTRATOR_TEARDOWN_TIMEOUT_SECONDSenv varteardown_timeout_secondskey in a neworchestrator_configtable inbot-bottle.dbThe new
OrchestratorConfigStore(key/value table, same shared DB, sameDbStore/TableMigrationspattern) stores the DB-level setting.resolve_teardown_timeout()implements the priority chain and is called at callback-registration time in each backend'slaunch.py.Scope
bot_bottle/orchestrator/config_store.py(OrchestratorConfigStore,resolve_teardown_timeout)teardown_consolidated()in all three backends gains atimeoutkeyword arglaunch.pyfiles passtimeout=resolve_teardown_timeout()tostack.callback