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
Ansible runner cleanup #547
Conversation
tinez
commented
Jul 21, 2022
- ansible: Remove unused things
- AnsibleRunnerClient: make 'mapper' a scoped object
/ost |
@@ -188,7 +179,6 @@ public int processEvents(String playUuid, | |||
} | |||
} | |||
lastEvent = event; | |||
returnValue.setLastEventId(getLastEventId()); | |||
lastEventId++; | |||
} | |||
return lastEvent.isEmpty() ? lastEventId : getLastEventId(); |
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.
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.
Yes, while I was going over the code trying to wrap my head around it I noticed some things that are unused. This one is not enough to fix the problem. Now rebased on top of Michal's changes.
None of the removed things are used: - we never do anything with neither 'msg' nor 'logFile' arguments of 'AnsibleRunnerClient.processEvents' - the 'AnsibleReturnValue' instance created in 'AnsibleCallback.doPolling' is used only locally and doesn't affect the logic
060d482
to
25cbbef
Compare
/ost |
.builder() | ||
.findAndAddModules() | ||
.build() | ||
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); |
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.
What's so harmful on having JsonMapper shared between threads? Unless I'm missing something we use that approach a lot in engine, because JsonMapper initialization takes some time ...
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.
Right, I thought sharing the mapper between threads might be an issue, but found in the docs: Mapper instances are fully thread-safe provided that ALL configuration of the instance occurs before ANY read or write calls
. Thanks!
25cbbef
to
5dcc52f
Compare
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AnsibleCallback.java
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.
I think next step would be synchronize around processEvents, but we would somehow need to handle logger, probably add that again as a parameter
/ost |