Skip to content

Conversation

@fregataa
Copy link
Member

@fregataa fregataa commented Jun 20, 2024

When we create a kernel, agent registers the kernel to kernel_registry before creating an actual container.
sync_container_lifecycles() task scans kernel_registry and deregister kernels that do not have an actual container.
If the task scans at the moment before the container is created after the kernel is registered, the kernel being created gets removed, which is a malfunction.

Let's add state field to Kernel object so that the task can omit to clean kernels being created.

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version

@graphite-app
Copy link

graphite-app bot commented Jun 20, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

fregataa commented Jun 20, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @fregataa and the rest of your teammates on Graphite Graphite

@fregataa fregataa added this to the 24.03 milestone Jun 20, 2024
@fregataa fregataa force-pushed the topic/06-20-fix_kernel_status_to_omit_being_cleaned branch from f0985d1 to 17b9bfa Compare June 20, 2024 15:12
@fregataa fregataa changed the title fix: Omit cleaning containerless kernels whose status is preparing fix: Omit cleaning containerless kernels which is still creating its container Jun 21, 2024
@fregataa fregataa force-pushed the topic/05-23-fix_enhanced_kernel_termination_handling branch 2 times, most recently from bd7d1e4 to 25e70f3 Compare June 24, 2024 07:05
@fregataa fregataa changed the title fix: Omit cleaning containerless kernels which is still creating its container fix: Omit cleaning containerless kernels which are still creating its container Jun 25, 2024
@fregataa fregataa force-pushed the topic/05-23-fix_enhanced_kernel_termination_handling branch 5 times, most recently from 552b746 to 59cbbc9 Compare July 5, 2024 09:56
Base automatically changed from topic/05-23-fix_enhanced_kernel_termination_handling to main July 5, 2024 11:51
@fregataa fregataa force-pushed the topic/06-20-fix_kernel_status_to_omit_being_cleaned branch from 17b9bfa to dcca90e Compare July 11, 2024 21:43
@fregataa fregataa requested a review from kyujin-cho July 12, 2024 03:00
@fregataa fregataa marked this pull request as ready for review July 12, 2024 03:00
@fregataa fregataa force-pushed the topic/06-20-fix_kernel_status_to_omit_being_cleaned branch from c8c6916 to a648eb3 Compare July 12, 2024 15:14
def __setstate__(self, props) -> None:
# Used when a `Kernel` object is loaded from pickle data.
if "state" not in props:
props["state"] = KernelLifecycleStatus.RUNNING
Copy link
Member Author

@fregataa fregataa Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we shutdown and restart an agent to update its version, kernel_registry is dumped as a pickle file and the agent loads the pickle file when it restarts. Old Kernel objects that are dumped before the version update do not have state field when we restart agent.
We need to insert the state value to the old Kernel objects.

@kyujin-cho kyujin-cho enabled auto-merge July 15, 2024 07:15
@kyujin-cho kyujin-cho added this pull request to the merge queue Jul 15, 2024
Merged via the queue into main with commit b1ec7e1 Jul 15, 2024
16 checks passed
@kyujin-cho kyujin-cho deleted the topic/06-20-fix_kernel_status_to_omit_being_cleaned branch July 15, 2024 07:22
lablup-octodog pushed a commit that referenced this pull request Jul 15, 2024
… container (#2317)

Co-authored-by: Kyujin Cho <[email protected]>
Backported-from: main (24.09)
Backported-to: 24.03
Backport-of: 2317
github-merge-queue bot pushed a commit that referenced this pull request Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:agent Related to Agent component size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants