-
Notifications
You must be signed in to change notification settings - Fork 263
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
AnsibleRunner: reset lastEvent #545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this is the onl break out of the infinite loop. So the return value condition is ineffective AFAICT and can just return lastEventId always?
...odules/bll/src/main/java/org/ovirt/engine/core/common/utils/ansible/AnsibleRunnerClient.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be best - or even required, looking at playHasEnded - to eliminate lastEvent completely
Could be... this is more question for @dangel101... in what situation we need lastEvent? |
Use the grep, Luke!
http://bezdelnique.ru/wp-content/uploads/2009/08/use_source_luke-500x388.png |
what I understand from code is it seems like we don't need it at all and we could just use |
/ost |
1 similar comment
/ost |
I've meant something more like #546 |
While we don't know how many events we expect, we do know that in any case the last event contains the run's stats. So that helps to determine if a run has actually ended |
When the runner gets
LastEventId
: 0 andtotalEvents
: 0. The client does not find any new events so we havenull
event and break thewhile(true)
.ovirt-engine/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/common/utils/ansible/AnsibleRunnerClient.java
Lines 124 to 128 in 9336b4f
The AnsibleCallback is using a singleton of the AnsibleRunnerClient because of this we get the previous run
lastEvent
which is not empty so we call getLastEventId`.ovirt-engine/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/common/utils/ansible/AnsibleRunnerClient.java
Line 194 in 9336b4f
In the
getLastEventId
we get the return of the prefix index of the file which is thelastEventId
and because it's from the previous run it overrides the current id.ovirt-engine/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/common/utils/ansible/AnsibleRunnerClient.java
Lines 111 to 113 in 9336b4f