-
Notifications
You must be signed in to change notification settings - Fork 42
improvement: Remove resource reservation cache and instead just use a store backed by a lister #254
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems like a good idea (and would allow us to revert the #262 hack), but unless I'm missing something won't this lead to a situation where we create an rr, we silently timeout trying to see that update, then later on we fail to see that rr because we're lagging behind?
(i guess you could argue that we already have this issue when running multiple spark scheduler nodes anyway?)
|
||
func (d *defaultStore) allowListerToSync(ctx context.Context, result *v1beta2.ResourceReservation) { | ||
ticker := time.NewTicker(time.Millisecond * 20) | ||
ctx, cancel := context.WithDeadline(ctx, time.Now().Add(time.Second*5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx, cancel := context.WithDeadline(ctx, time.Now().Add(time.Second*5)) | |
ctx, cancel := context.WithTimeout(ctx, time.Second*5) |
return err | ||
} | ||
|
||
func (d *defaultStore) allowListerToSync(ctx context.Context, result *v1beta2.ResourceReservation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the potential unintended consequences on this failing silently, should this return an error at least?
return err | ||
} | ||
d.allowListerToSync(ctx, result) | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return err | |
return nil |
return err | ||
} | ||
d.allowListerToSync(ctx, result) | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return err | |
return nil |
return rrm.resourceReservations.Get(namespace, appID) | ||
func (rrm *ResourceReservationManager) GetResourceReservation(ctx context.Context, appID string, namespace string) (*v1beta2.ResourceReservation, bool) { | ||
r, err := rrm.resourceReservationStore.Get(ctx, namespace, appID) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err != nil { | |
return r, err == nil |
Before this PR
After this PR
==COMMIT_MSG==
==COMMIT_MSG==
Possible downsides?