Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-Request Checklist
rubocop --auto-correct
)rake test
)Changes are reflected in the documentationUser-visible changes appended to CHANGELOG.mdDescription
Current code:
If the node is running while
next(node)
is called,waiting.find_node_index(node)
will throw an exception because the running node is not in this waiting list.The indented behavior is a direct return from the next function.
My changes
I changed to code so that it uses the
find_index()
function instead, because if the node is not found there, it will simply return nil.I also switched
return unless waiting.find_index(node)
toreturn if running.find_index(node)
. The running list is just the inverse of the waiting list, but it should be much shorter.To be able to call
find_index()
on the running/waiting list, the function had to be moved from the private scope to the public scope.I ran the tests and rubocop without any problems. I also tested it directly in our oxidized installation and it fixed the Web API /next returns status 500 if node is waiting to poll issue.
Closes issue #3163