Repository navigation
Bind the Session's Environment on the agent host - #536
Merged
Merged
Conversation
The binding reads return the Session's Environment beside the device's own and accept the deployment's agent host. Every Bind caller passes the Session's Environment, and an agent host's bind to an Environment without a live Link resource fails with ErrNoLinkResource before anything is sent.
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.
Core binds an agent host with the Session's Environment, so production binds carry the Link resource and attach grant. Placement still never chooses the agent host; PR5c-2 does.
GetSessionDeviceandGetSessionExecutionBindingaccept the deployment's agent host (no tenant) as the bound Runtime and return the Session's Environment (session_environment_id) beside the device's ownenvironment_id.sessions.ExecutionDevicegainsSessionEnvironmentID;environmentDeviceMatchesandnoneplacement keep reading the device's until PR5c-2.assignedRuntimePeerand initialization bind with the Session's Environment.bindLink. A bind of an agent host that holds the assignment, to an Environment without a live Link resource, fails withErrNoLinkResourcebefore anything is sent; callers map it to their existing unavailable outcomes.nonestill binds without Link fields.checkInitializationDevicechecks only that the listed Runtime is still the bound one; the query keeps the device-Environment rule.docs/runtime-protocol.md(+zh): with no live resource, Core sends the agent host no bind and the operation fails.Tests
TestInitializationBindsAgentHost: the agent host registered as PR5a does it and connected, with an assignment row inserted by SQL; initialization sendsassignment_bindwith the exactresourceand anattach_grant, and without a live resource it fails before any bind.link_authority_test.gobinds through the Worker's initialization path instead of callingpeer.Binddirectly.execution,runtimegateway,sessions,sessionpg; 82 integration tests across dispatch, initialization, Environment files and Link authority;-race -count=50on the new and Link tests;make check-names check-docs check-ci.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.