# Callback-Plugin instance per fork - how to synchronize them?

**URL:** <https://forum.ansible.com/t/callback-plugin-instance-per-fork-how-to-synchronize-them/19863>\
**Category:** Ansible Project\
**Created:** [November 26, 2015, 12:32pm UTC](https://forum.ansible.com/t/callback-plugin-instance-per-fork-how-to-synchronize-them/19863 "2015-11-26T12:32:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Wenig](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Michael\_Wenig](https://forum.ansible.com/u/Michael_Wenig)\
**Post date:** [November 26, 2015, 12:32pm UTC](https://forum.ansible.com/t/callback-plugin-instance-per-fork-how-to-synchronize-them/19863/1 "2015-11-26T12:32:22Z")

</div>

Hi,

we have a callback plugin which gathers information (warnings and errors) about tasks and should display a summary at the end in playbook\_on\_stats as a summary.

This is actually done by storing the information in a dict inside the callback plugin.

Unfortunately it seems that there is one instance per fork and in sum ist only the first one created used (the instance used on controller),

So we currently loose all data gathered during execution of forked tasks on the nodes if we set fork \> 1.

Is one instance per fork expected behaviour and how should we synchronize it?

here are the relevant parts of code:\_

`

class CallbackModule(object):

saved\_logs = {}  
…

def runner\_on\_error(self, host, msg):

… add something to saved\_logs

def playbook\_on\_stats(self, stats):

output all of saved\_logs

`

Some of the task which are creating logs are implemented as modules and run on the nodes and not on the controller - these information gets lost in playbook\_on\_stats

Do you have any hints?

Regards Micha
