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

core: fix start_event_monitor logic #5626

Merged
merged 1 commit into from
Nov 30, 2015

Conversation

simon3z
Copy link
Contributor

@simon3z simon3z commented Nov 27, 2015

In some cases @tid could be dead (not alive?) but still have a status, which would lead to an infinite loop.

In fact:

@tid ||= start_event_monitor

would never start a new event_monitor (since @tid already has value), and:

if @tid.status.nil?
  dead_tid, @tid = @tid, nil
  ...

would never take place as @tid.status is not nil resulting in an infinite loop.

This issue was introduced in #4939

cc @jvlcek @Fryguy @chessbyte @blomquisg

In some cases `@tid` could be dead (not `alive?`) but still have a
`status`, which would lead to an infinite loop.

In fact:

    @tid ||= start_event_monitor

would never `start` a new `event_monitor` (since `@tid` already has
value), and:

    if @tid.status.nil?
      dead_tid, @tid = @tid, nil
      ...

would never take place as `@tid.status` is not `nil` resulting in an
infinite loop.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
@simon3z
Copy link
Contributor Author

simon3z commented Nov 27, 2015

@miq-bot add_label core, bug

@miq-bot
Copy link
Member

miq-bot commented Nov 27, 2015

Checked commit simon3z@aedb823 with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0
1 file checked, 0 offenses detected
Everything looks good. 🍰

@jvlcek
Copy link
Member

jvlcek commented Nov 30, 2015

@simon3z; This looks correct to me. I would like @matthewd to also review it.

matthewd added a commit that referenced this pull request Nov 30, 2015
@matthewd matthewd merged commit 78e0940 into ManageIQ:master Nov 30, 2015
@matthewd matthewd added this to the Sprint 33 Ending Dec 7, 2015 milestone Nov 30, 2015
dclarizio pushed a commit to dclarizio/manageiq that referenced this pull request Dec 16, 2015
core: fix start_event_monitor logic

In some cases `@tid` could be dead (not `alive?`) but still have a
`status`, which would lead to an infinite loop.

In fact:

    @tid ||= start_event_monitor

would never `start` a new `event_monitor` (since `@tid` already has
value), and:

    if @tid.status.nil?
      dead_tid, @tid = @tid, nil
      ...

would never take place as `@tid.status` is not `nil` resulting in an
infinite loop.

Upstream: ManageIQ#5626
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1285341


See merge request !556
@simon3z simon3z deleted the fix-start-event-monitor branch December 21, 2015 11:24
matthewd added a commit that referenced this pull request Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants