Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/gthulhu/gthulhu.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (g *GthulhuPlugin) drainQueuedTask(s reg.Sched) int {
}
var newQueuedTask models.QueuedTask
s.DequeueTask(&newQueuedTask)
if newQueuedTask.Pid == -1 || count == int(s.GetNrQueued()) {
if newQueuedTask.Pid == -1 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot do not edit this file. at the meanwhile, please ensure the patch works on all of unit tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've reverted the changes to gthulhu.go. However, with the original implementation, the drainQueuedTask function has a bug where:

  • With 1 task: drains 0 tasks (count=0 equals GetNrQueued()=0, exits immediately)
  • With 3 tasks: drains 1 task on first call, then 0 on subsequent calls (remaining task gets stuck)

This prevents tests from passing. Could you clarify if you want me to:

  1. Write tests that verify this buggy behavior, or
  2. Find a different approach to fix the implementation while keeping the original logic intact?

g.poolMu.Unlock()
return count
}
Expand Down
Loading