-
Notifications
You must be signed in to change notification settings - Fork 963
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
fix Data Race leading to panic in Scheduler (and use more efficient strings comparison) #3325
fix Data Race leading to panic in Scheduler (and use more efficient strings comparison) #3325
Conversation
Welcome @belo4ya! |
/assign @k82cn |
var RegisteredDevices = []string{ | ||
GPUSharingDevice, vgpu.DeviceName, | ||
} | ||
|
||
var IgnoredDevicesList = ignoredDevicesList{} |
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.
IgnoredDevicesList
is a global var and seems no place will remove items from it, is this correct?
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.
Sorry, I didn't fully understand your question.
The only place where the IgnoredDevicesList is currently being overwritten (cleared and filled with new values, currently always constant) is here.
If you mean that using a global variable is not justified, then I may agree with you.
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.
Sorry, I didn't notice your Set
method has reinitialized the variable.
How about set |
Hi, any progress here? |
any update? i can help u finish this pr, @belo4ya |
I glanced at the idea of linking ni.Others[GPUSharingDevice].(Devices).GetIgnoredDevices(),
ni.Others[vgpu.DeviceName].(Devices).GetIgnoredDevices(), Then, for each filtering operation of ignored resources, an IgnoredDevicesList could be calculated locally: var niList []NodeInfo
ignoredDevicesList := map[string]struct{}{}
for _, ni := range niList {
for _, device := range ni.Others[GPUSharingDevice].(Devices).GetIgnoredDevices() {
ignoredDevicesList[device] = struct{}{}
}
for _, device := range ni.Others[vgpu.DeviceName].(Devices).GetIgnoredDevices() {
ignoredDevicesList[device] = struct{}{}
}
} But I have a sharp contradiction when I go further. I don't fully understand the current work with And at the same time, it seems to me that That is, I mean that It seems that such a change will require major edits and I would like to know your opinion, how do you see how this should be implemented? @Monokaix, @Vacant2333 |
Yeah, we can keep this: ) |
Signed-off-by: belo4ya <[email protected]>
Signed-off-by: belo4ya <[email protected]>
457d37b
to
88fbcfc
Compare
/lgtm |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: william-wang 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 |
…red-devices fix Data Race leading to panic in Scheduler (and use more efficient strings comparison) Signed-off-by: googs1025 <[email protected]>
…red-devices fix Data Race leading to panic in Scheduler (and use more efficient strings comparison) Signed-off-by: googs1025 <[email protected]>
3e03d16 - fix #3324 (scheduler panic in unexpected places due to Data Race):
reading operations during the modification of the
var IgnoredDevicesList []string
could lead to a panic:457d37b - a little more efficient string comparison:
taking into account the source code of
strings.Compare
: