Repository navigation
feat: configure database polling and skip unchanged MCP writes - #3038
Merged
Merged
Conversation
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Forward-port dd889a1 to the current MCP controllers. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
EItanya
force-pushed
the
feat/configurable-postgres-polling
branch
from
October 3, 2026 12:23
2777dba to
e132a5c
Compare
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
EItanya
marked this pull request as ready for review
October 3, 2026 12:33
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
alexdarbyshire
pushed a commit
to alexdarbyshire/kagent
that referenced
this pull request
Oct 5, 2026
…t-dev#3038) Several controller workers query PostgreSQL every second even when there is no pending work, which keeps serverless databases active. This makes sandbox expiration, scheduled-run reservation and execution, and runtime revision cleanup intervals configurable through the existing environment accessors, preserving current defaults. Workers reject nonpositive intervals. Session quiescence stays fixed at one second because longer intervals leave actors running after task completion or while waiting for input. kagent-dev#3040 tracks waking these workers in memory after settlement, with slower recovery scans. This PR does not eliminate all idle database polling. Agent and sandbox-template preparation checks also stay fixed at one second. They scan cached state and do not query PostgreSQL once preparation and cleanup are settled, so slowing them would delay readiness without helping the database become idle. Forward-ports [dd889a1](kagent-dev@dd889a1) to the current MCPServer and RemoteMCPServer controllers: discovery keeps its existing cadence, while unchanged catalogs skip PostgreSQL writes. Failed writes and deletion invalidate the cached observation so retries still reach the database. `LastConnected` records the last persisted connected observation. Uses the PostgreSQL pool configuration from kagent-dev#3032. Defaults and latency tradeoffs stay in the existing environment-variable reference, including the 30-second lateness window for cron firings. Validation: affected Go packages with the race detector, including an MCP test that closes the PostgreSQL pool before repeating unchanged discovery; Go lint; Helm controller/database tests; generated environment documentation check. --------- Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several controller workers query PostgreSQL every second even when there is no pending work, which keeps serverless databases active. This makes sandbox expiration, scheduled-run reservation and execution, and runtime revision cleanup intervals configurable through the existing environment accessors, preserving current defaults. Workers reject nonpositive intervals.
Session quiescence stays fixed at one second because longer intervals leave actors running after task completion or while waiting for input. #3040 tracks waking these workers in memory after settlement, with slower recovery scans. This PR does not eliminate all idle database polling.
Agent and sandbox-template preparation checks also stay fixed at one second. They scan cached state and do not query PostgreSQL once preparation and cleanup are settled, so slowing them would delay readiness without helping the database become idle.
Forward-ports dd889a1 to the current MCPServer and RemoteMCPServer controllers: discovery keeps its existing cadence, while unchanged catalogs skip PostgreSQL writes. Failed writes and deletion invalidate the cached observation so retries still reach the database.
LastConnectedrecords the last persisted connected observation.Uses the PostgreSQL pool configuration from #3032. Defaults and latency tradeoffs stay in the existing environment-variable reference, including the 30-second lateness window for cron firings.
Validation: affected Go packages with the race detector, including an MCP test that closes the PostgreSQL pool before repeating unchanged discovery; Go lint; Helm controller/database tests; generated environment documentation check.