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

Return value of getSchedulers is not safe #2630

Closed
rleungx opened this issue Jul 13, 2020 · 0 comments · Fixed by #2615
Closed

Return value of getSchedulers is not safe #2630

rleungx opened this issue Jul 13, 2020 · 0 comments · Fixed by #2615
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Comments

@rleungx
Copy link
Member

rleungx commented Jul 13, 2020

In server/cluster/coordinator.go, we have a function named getSchedulers.

func (c *coordinator) getSchedulers() map[string]*scheduleController {
	c.RLock()
	defer c.RUnlock()
        return c.schedulers
}

But here we directly return a map that may not safe if we do some operations concurrently on this map outside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant