-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
In some circumstances Events never get cleared from callback_receiver buffer. #13368
Comments
I reproduced this by crafting a stupid plugin that causes null characters to be printed to stdout: shanemcd/test-playbooks@40edb76 Then used this inventory plugin by using an inventory source from a project: The key here is that the bad character needs to be printed to stdout so it's passed into ansible_runner's event_callback via the handler we pass to pexpect: The full breadcrumb trail for those that are interested: If the null character is passed through Ansible's callback system we don't see this because it's escaped when we load the event data here: Upon running my inventory sync with this bad plugin, I see this in my logs:
|
Connect #13398 This issue seems to have gotten lost, @jay-steurer looked at the PRs. I am fairly confident that addressed everything described in this issue. |
I will double-check it. As Alan mentioned, we had a PR for this issue. |
I was able to reproduce this issue using @shanemcd playbook
Moving this issue to the backlog |
^ that output from the example inventory still get saved. The log shows Instead, this is just an error log that sends it to the fallback logic. If you look at the patch review comments, #13398 (comment), you see they're all about performance. We do a replacement for this specific character (because it's a postgres-level error), but only after an initial try has been used and had an error. This is because of the performance impact of doing a find and replace on all events in the buffer - many of which are error-free, but didn't get saved because they were in the buffer alongside of error events. The logs are noisy, yes, but that's because what the inventory does isn't really valid. This is working as designed. |
Please confirm the following
Bug Summary
Events of a certain type can cause issues with the callback's bulk create. In those cases, some events can make it into the database and will later cause duplicate key errors:
The above exception breaks the initial bulk create that then causes the other issue:
Those events never get cleared from the buffer and are later attempted again:
AWX version
devel
Select the relevant components
Installation method
docker development environment
Modifications
no
Ansible version
2.14.0
Operating system
RHEL
Web browser
No response
Steps to reproduce
Expected results
All event data is saved to the database
Actual results
some events never make it to the database and are not cleared from the callback receiver's buffer.
Additional information
This issue seems to be caused initially by bad result data from an event, which causes a bulk create to fail after inserting X number of events, those events are then reprocessed and raise a duplicate key error repeatedly.
The text was updated successfully, but these errors were encountered: