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

update golang to v1.17 #1912

Merged
merged 2 commits into from Dec 20, 2021
Merged

Conversation

Thor-wl
Copy link
Member

@Thor-wl Thor-wl commented Dec 20, 2021

As kubernetes-sigs/controller-tools#643 mentions, there may be some bugs in package encoding for golang v1.16.x. This PR should be merged before #1910
Signed-off-by: Thor-wl 13164644535@163.com

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 20, 2021
@Thor-wl Thor-wl requested review from shinytang6 and william-wang and removed request for wpeng102 and yuanchen8911 December 20, 2021 09:08
@Thor-wl
Copy link
Member Author

Thor-wl commented Dec 20, 2021

Not sure which PR has introduces this bug or is there something wrong with this UT case. Ignore it temporarily. Will look into it and then give the fix.
截图

@hwdef
Copy link
Member

hwdef commented Dec 20, 2021

I met this error, too.
Very confused

@volcano-sh-bot volcano-sh-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 20, 2021
@Thor-wl
Copy link
Member Author

Thor-wl commented Dec 20, 2021

I reviewed the UT file allocate_test.go and it was not changed recently. So I guess there may be some wrong update with the allocate.go. @justadogistaken I noticed that only this PR #1906 was merged with this file recently. So can you help give a test about this bug? I've tested for serval times and found that the allocations are not stable. Namely, the output allocations are not unique. There are small probability to be same with expected.

@justadogistaken
Copy link
Member

I reviewed the UT file allocate_test.go and it was not changed recently. So I guess there may be some wrong update with the allocate.go. @justadogistaken I noticed that only this PR #1906 was merged with this file recently. So can you help give a test about this bug? I've tested for serval times and found that the allocations are not stable. Namely, the output allocations are not unique. There are small probability to be same with expected.

I reset my commit to the pr ahead of PR #1906, this error exists previously. But this may not be an error. Pods of c1/p1, c1/p2, c2/p1, c2/p2 have same requests. This error will happen if c1/p2 gets into tasks(priorityQueue) first or c2/p2 gets into first instead of p1.

@justadogistaken
Copy link
Member

Let's check this out.
TaskStatusIndex will return a taskMap, which is like map[TaskID]*TaskInfo.
And map does not have a concrete order while being accessed.
So it could happen to p2 is accessed before p1 in a pg.
But the result is correct.
The problem is that the "expected: "c2/p1": "n1", "c1/p1": "n1"" in UT is not appropriate.
It should be like "c1/ p1 or p2, c2/ p1 or p2".

			for _, task := range job.TaskStatusIndex[api.Pending] {
				// Skip BestEffort task in 'allocate' action.
				if task.Resreq.IsEmpty() {
					klog.V(4).Infof("Task <%v/%v> is BestEffort task, skip it.",
						task.Namespace, task.Name)
					continue
				}

				tasks.Push(task)
			}

@huone1
Copy link
Contributor

huone1 commented Dec 20, 2021

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2021
@huone1
Copy link
Contributor

huone1 commented Dec 20, 2021

/approve

@justadogistaken
Copy link
Member

There was a pr #1898 removing the follwing block.
Tasks will be sort by UID(***-p1, ***-p2) Originally.

	if lv.Pod.CreationTimestamp.Equal(&rv.Pod.CreationTimestamp) {
		return lv.UID < rv.UID
	}
	return lv.Pod.CreationTimestamp.Before(&rv.Pod.CreationTimestamp)

截屏2021-12-20 下午7 43 31

@Thor-wl
Copy link
Member Author

Thor-wl commented Dec 20, 2021

There was a pr #1898 removing the follwing block. Tasks will be sort by UID(***-p1, ***-p2) Originally.

	if lv.Pod.CreationTimestamp.Equal(&rv.Pod.CreationTimestamp) {
		return lv.UID < rv.UID
	}
	return lv.Pod.CreationTimestamp.Before(&rv.Pod.CreationTimestamp)
截屏2021-12-20 下午7 43 31

/cc @xiaoanyunfei Pls help take a look and make corresponding UT cases changed if the allocate logic changes. THX.

Signed-off-by: Thor-wl <13164644535@163.com>
Signed-off-by: Thor-wl <13164644535@163.com>
@volcano-sh-bot volcano-sh-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 20, 2021
@huone1
Copy link
Contributor

huone1 commented Dec 20, 2021

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2021
Copy link
Member

@shinytang6 shinytang6 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: huone1, shinytang6

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 20, 2021
@volcano-sh-bot volcano-sh-bot merged commit 2c9658c into volcano-sh:master Dec 20, 2021
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. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants