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

check job ActiveDeadlineSeconds #48454

Merged

Conversation

weiwei04
Copy link
Contributor

@weiwei04 weiwei04 commented Jul 4, 2017

What this PR does / why we need it:

enqueue a sync task after ActiveDeadlineSeconds

Which issue this PR fixes *:

fixes #32149

Special notes for your reviewer:

Release note:

enqueue a sync task to wake up jobcontroller to check job ActiveDeadlineSeconds in time

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 4, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @weiwei04. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 4, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 4, 2017
@weiwei04 weiwei04 force-pushed the check-job-activeDeadlineSeconds branch from 8ebd760 to 0432a5f Compare July 4, 2017 06:19
@weiwei04
Copy link
Contributor Author

weiwei04 commented Jul 4, 2017

/assign @janetkuo

@k8s-ci-robot
Copy link
Contributor

@weiwei04: GitHub didn't allow me to assign the following users: PTAL.

Note that only kubernetes members can be assigned.

In response to this:

/assign @janetkuo PTAL

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@weiwei04
Copy link
Contributor Author

weiwei04 commented Jul 7, 2017

@janetkuo please take a look, thanks.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 18, 2017
@weiwei04 weiwei04 force-pushed the check-job-activeDeadlineSeconds branch from 0432a5f to 5a888ac Compare July 19, 2017 08:05
@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 19, 2017
@weiwei04 weiwei04 force-pushed the check-job-activeDeadlineSeconds branch from 5a888ac to 0218c72 Compare July 31, 2017 06:41
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2017
@soltysh
Copy link
Contributor

soltysh commented Jul 31, 2017

@weiwei04 sorry, was out for quite a long, will look into it today or tomorrow.

@weiwei04
Copy link
Contributor Author

weiwei04 commented Aug 1, 2017

@soltysh thanks:)

@soltysh
Copy link
Contributor

soltysh commented Aug 2, 2017

/assign

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Mostly nits, overall looks good.

curJob := cur.(*batch.Job)

// never return error
key, _ := controller.KeyFunc(curJob)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no point in re-trying if there was an error. Check error and just return if that happens.

jm.queue.Add(key)
// check if need to add a new rsync for ActiveDeadlineSeconds
if curJob.Status.StartTime != nil {
curSeconds := curJob.Spec.ActiveDeadlineSeconds
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please use currentADS and oldADS it's less confusing name :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes ADS would be a more meaningful name:)

@@ -150,6 +150,10 @@ const (
JobFailed JobConditionType = "Failed"
)

const (
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed, drop it. It'll cause only confusion wrt to our API.

@@ -28,6 +28,8 @@ import (
"k8s.io/kubernetes/pkg/kubectl"
"k8s.io/kubernetes/test/e2e/framework"

batch "k8s.io/api/batch/v1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use batchv1 as the name alias, to make it clear it's that version.

@@ -86,9 +88,20 @@ var _ = SIGDescribe("Job", func() {
Expect(err).NotTo(HaveOccurred())
})

It("should exceed active deadline", func() {
By("Creating a job")
var activeDeadlineSeconds int64 = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

Make it shorter, this will cause the entire test suite longer by 10 seconds. I'd propose 1-2 seconds max.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to 2 seconds.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2017
@weiwei04 weiwei04 force-pushed the check-job-activeDeadlineSeconds branch from 36896d9 to 1662f30 Compare August 8, 2017 06:10
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2017
@weiwei04
Copy link
Contributor Author

weiwei04 commented Aug 8, 2017

@soltysh modified code according to your comments, please take a look, thanks:)

@dims
Copy link
Member

dims commented Aug 9, 2017

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 9, 2017
@weiwei04
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@weiwei04
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-etcd3

@weiwei04
Copy link
Contributor Author

@soltysh modified code according to your comments, and all the test are passed, please take a look, thanks:)

@weiwei04
Copy link
Contributor Author

ping @soltysh :)

1 similar comment
@weiwei04
Copy link
Contributor Author

ping @soltysh :)

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 25, 2017
@weiwei04
Copy link
Contributor Author

ping @soltysh :)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 29, 2017
@soltysh
Copy link
Contributor

soltysh commented Aug 29, 2017

@weiwei04 sorry for the long silence, looking at it right now...

@soltysh soltysh added this to the v1.8 milestone Aug 29, 2017
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

LGTM

@soltysh
Copy link
Contributor

soltysh commented Aug 29, 2017

@weiwei04 mind squashing these changes into a single commit and I'll apply all the necessary labels for merge

@weiwei04 weiwei04 force-pushed the check-job-activeDeadlineSeconds branch from 92e91cc to 46239ea Compare August 29, 2017 12:15
@soltysh
Copy link
Contributor

soltysh commented Aug 29, 2017

/test pull-kubernetes-node-e2e

@soltysh
Copy link
Contributor

soltysh commented Aug 29, 2017

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 29, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: soltysh, weiwei04

Associated issue: 32149

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2017
@weiwei04
Copy link
Contributor Author

Thanks:)

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 44719, 48454)

@k8s-github-robot k8s-github-robot merged commit 25da6e6 into kubernetes:master Aug 29, 2017
@weiwei04 weiwei04 deleted the check-job-activeDeadlineSeconds branch August 30, 2017 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too long time needed for a job to be killed after exceeding relatively short ActiveDeadlineSeconds
7 participants