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

Scheduler: First-fit algorithm throws exception for empty device list #29

Open
marusshi opened this issue Sep 17, 2018 · 1 comment
Open

Comments

@marusshi
Copy link
Collaborator

Scheduler.js:282 : devices[0] is undefined

tasks.forEach(function(task){
	var most_space = Object.keys(mapping).reduce(function(acc, id){
		return (mapping[id].available_memory > mapping[acc].available_memory) ? id : acc;
	}, devices[0].id); 

Error thrown:

     TypeError: Cannot read property 'id' of undefined
@jungkumseok jungkumseok changed the title Scheduler: First-fit algorithm throws exception for empty device list but non-empty task list Scheduler: First-fit algorithm throws exception for empty device list Oct 1, 2018
@jungkumseok
Copy link
Collaborator

If the device list is empty, that part of the code should not even be executed. I think we should throw a "no solution" error if the given device list is empty

@marusshi marusshi mentioned this issue Oct 9, 2018
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

No branches or pull requests

2 participants