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

[YUNIKORN-2724] Improve the signature of methods notifyTaskComplete() and ensureAppAndTaskCreated() #873

Closed
wants to merge 15 commits into from

Conversation

ryankert01
Copy link
Contributor

@ryankert01 ryankert01 commented Jul 8, 2024

What is this PR for?

From the review #864

Change notifyTaskComplete(string, string) to notifyTaskComplete(*Application, string). It removes a number of extra getApplication() calls we really do not need.
Similar for ensureAppAndTaskCreated() which is only ever called from this function. Add a parameter to it to make it: ensureAppAndTaskCreated(*v1.Pod, *Application) and only execute application creation if app == nil.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

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

How should this be tested?

make test

github ci

Screenshots (if appropriate)

Questions:

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

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.

Project coverage is 68.07%. Comparing base (c5f4074) to head (788d6d9).

Files Patch % Lines
pkg/cache/context.go 69.56% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #873      +/-   ##
==========================================
- Coverage   68.08%   68.07%   -0.01%     
==========================================
  Files          70       70              
  Lines        7577     7575       -2     
==========================================
- Hits         5159     5157       -2     
  Misses       2203     2203              
  Partials      215      215              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pbacsko pbacsko self-requested a review July 23, 2024 05:56
@pbacsko pbacsko marked this pull request as ready for review August 1, 2024 10:07
@pbacsko pbacsko requested a review from wilfred-s August 1, 2024 10:07
@pbacsko
Copy link
Contributor

pbacsko commented Aug 1, 2024

@ryankert01 please rebase the PR with the latest master, thx.

@pbacsko
Copy link
Contributor

pbacsko commented Aug 1, 2024

Nevermind, I updated the PR with master, please check if it's OK.

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.

Missing the change for ensureAppAndTaskCreated as per the jira

pkg/cache/context.go Outdated Show resolved Hide resolved
pkg/cache/context.go Outdated Show resolved Hide resolved
@brandboat brandboat changed the title [YUNIKORN-2724] Improve the signature of methods notifyTaskComplete()… [YUNIKORN-2724] Improve the signature of methods notifyTaskComplete() and ensureAppAndTaskCreated() Aug 4, 2024
@brandboat
Copy link
Member

gentle ping @ryankert01, could you please fix the conflicts ? Thanks.

@ryankert01 ryankert01 marked this pull request as draft August 6, 2024 11:27
@ryankert01 ryankert01 marked this pull request as ready for review August 8, 2024 13:06
@ryankert01 ryankert01 requested a review from wilfred-s August 8, 2024 13:37
@ryankert01
Copy link
Contributor Author

Just finished the PR, ready for review now!

Copy link
Member

@brandboat brandboat left a comment

Choose a reason for hiding this comment

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

Thanks for the patch.

pkg/cache/context.go Outdated Show resolved Hide resolved
pkg/cache/context.go Outdated Show resolved Hide resolved
pkg/cache/context.go Outdated Show resolved Hide resolved
@ryankert01 ryankert01 requested a review from brandboat August 9, 2024 04:17
Copy link
Member

@brandboat brandboat left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

}
return
}
log.Log(log.ShimContext).Debug("notifyTaskComplete and release allocation",
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can keep origin message? release allocation

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 change the message to "notifyTaskComplete and release allocation" because I combine 2 logs to make it only log once. Perhaps I can change it to " release allocation in notifyTaskComplete"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. It is fine to keep current message :)

@ryankert01 ryankert01 requested a review from chia7712 August 11, 2024 13:54
Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@chia7712 chia7712 closed this in 286abb6 Aug 11, 2024
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.

5 participants