Skip to content

Conversation

@manirajv06
Copy link
Contributor

…empted allocations

What is this PR for?

Placeholder allocations are already preempted just before release needed for replacement with real allocation. Detect this condition just before doing replacement by acquiring single lock to read "preempted" flag and set "released" to true if earlier flag is false. Otherwise, throw the error and revert the steps carried out from the replacement side.

There could be similar occurrence in the (intra-queue) preemption cycle where victim got released just before kill command. Applied the same (reversed) checks using single lock to halt the preemption process abruptly without killing the other victims if any of the victim is already released.

There could be similar occurrence in the daemon set preemption cycle where victim got released just before kill command. Log the warning message and proceed with other victims.

There could be similar occurrence in the Quota change preemption cycle where victim got released just before kill command. Log the warning message and proceed with other victims.

In addition, some refactoring and clean up.

What type of PR is it?

  • - Improvement

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-3190

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

Copy link
Contributor

@wilfred-s wilfred-s left a comment

Choose a reason for hiding this comment

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

Marked a couple of examples but the comment is the same for this whole PR: try keep the key in the logging short. placeholders already preempted while tried to release is too long and makes reading and parsing tge log more difficult. Use 1-2 words.

Please check all newly added log entries.

Comment on lines +353 to +355
zap.String("AppID", sa.ApplicationID),
zap.Int("placeholders being replaced", replacing),
zap.Int("placeholders already preempted while tried to release", preempted),
Copy link
Contributor

Choose a reason for hiding this comment

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

shorten text in the log: replaced, preempted

Comment on lines 432 to +433
zap.Int("placeholders being replaced", replacing),
zap.Int("placeholders already preempted while tried to release", preempted),
Copy link
Contributor

Choose a reason for hiding this comment

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

shorten text to replaced and preempted

zap.String("AppID", sa.ApplicationID),
zap.Int("releasing placeholders", len(toRelease)),
zap.Int("pending placeholders", len(pendingRelease)),
zap.Int("placeholders already preempted while tried to release", preempted),
Copy link
Contributor

Choose a reason for hiding this comment

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

shorten text to preempted we should not repeat `placeholders in the two lines above either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants