Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(actors): refactor pods.go without actors [DET-9901] #8170

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

stoksc
Copy link
Contributor

@stoksc stoksc commented Oct 17, 2023

Description

Change pods.go from an actor to a plain Go struct with locks and make all calls synchronous. The change is simple; most of the work is in making sure this causes no bugs like deadlocks or race conditions, and no performance issues due to lock contention.

Test Plan

  • cover by unit tests and normal "is k8s working" tests

Commentary (optional)

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Ticket

DET-9901

@stoksc stoksc requested a review from a team as a code owner October 17, 2023 13:38
@cla-bot cla-bot bot added the cla-signed label Oct 17, 2023
@netlify
Copy link

netlify bot commented Oct 17, 2023

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 06615db
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/652ec24e05a51700085d9261

@stoksc stoksc changed the title chore(actors): refactor pods.go without actors chore(actors): refactor pods.go without actors [DET-9901] Oct 17, 2023
@stoksc stoksc force-pushed the refactor-pods-oss branch 2 times, most recently from 2e1d454 to d531854 Compare October 17, 2023 16:13
@@ -615,13 +602,13 @@ func (p *pods) refreshPodStates(ctx *actor.Context, allocationID model.Allocatio
continue
}
pod := pod
p.podStatusCallback(ctx.Self().System(), watch.Event{Object: &pod})
p.podStatusCallback(system, watch.Event{Object: &pod})
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to completely remove actors from pods if we can resolve this? Maybe passing in a callback or interface to Initialize?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to fix this when i do k8s resource pool. felt it would be easier then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

at that point, i won't be able to ctx.Tell the cluster anyway, so it will have to happen.

Copy link
Contributor

@carolinaecalderon carolinaecalderon left a comment

Choose a reason for hiding this comment

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

LGTM

@stoksc stoksc merged commit 36ad3ca into main Oct 18, 2023
75 of 86 checks passed
@stoksc stoksc deleted the refactor-pods-oss branch October 18, 2023 18:04
@dannysauer dannysauer added this to the 0.26.3 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants