Merged
Conversation
…. setup_vdrv.py will need to be run separately due to how vctl install uses the main setup.py.
…heartbeats throughout the interval.
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.
This pull request introduces several improvements to the
platform_driveragent, focusing on better agent shutdown handling, improved heartbeat logic, and some dependency cleanup. The key changes involve using ageventevent to signal agent shutdown, refactoring the heartbeat mechanism to be more responsive to agent stop events, and removing an unnecessary installation step fromsetup.py.Agent shutdown and heartbeat improvements:
_stop_agentevent to the agent and a@Core.receiver('onstop')handler to set this event when the agent is stopping, enabling coordinated and graceful shutdown of greenlets. [1] [2]heart_beatmethod to run in a loop, checking for the_stop_agentevent and sleeping dynamically based on the number of remotes. This ensures heartbeats stop promptly when the agent is stopped and distributes the heartbeat interval across remotes.gevent.spawninstead ofself.core.periodic, giving more control over the heartbeat loop and its termination.Dependency and import updates:
Eventfromgevent.eventto support the new shutdown mechanism.Corefrom the appropriatevip.agentmodule for both client and platform contexts, enabling the use of the@Core.receiverdecorator. [1] [2]Setup script cleanup:
vdrvfromsetup.py, streamlining the setup process.