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

Fix enqueue jobs #261

Merged
merged 1 commit into from
Jan 28, 2022
Merged

Conversation

seitau
Copy link
Contributor

@seitau seitau commented Jan 28, 2022

Fixed: #260

Fixed issue with rescheduling jobs. The cause of the problem was the use of pointer when sending jobs to channel.
The previous implementation was sending pointer of j to channel and it resulted in that queued jobs reference same address.

So I fixed to send each job's pointer to channel.

Before

for _, j := range jobs {
  wp.tryEnqueue(&j, true)
}

After

for i := range jobs {
  wp.tryEnqueue(&jobs[i], true)
}

@seitau seitau changed the title fix: enqueue jobs Fix enqueue jobs Jan 28, 2022
@nanuuki
Copy link
Contributor

nanuuki commented Jan 28, 2022

Nice catch @seita-uc and thank you for the fix! 👍

@nanuuki nanuuki merged commit 3744f84 into flow-hydraulics:main Jan 28, 2022
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

Successfully merging this pull request may close these issues.

Duplicate jobs get queued when rescheduling uncompleted jobs
2 participants