engines/rados: changed polling to completion callbacks methodology
authorAdam Kupczyk <akupczyk@redhat.com>
Mon, 25 Nov 2019 17:55:07 +0000 (12:55 -0500)
committerAdam Kupczyk <akupczyk@redhat.com>
Mon, 25 Nov 2019 18:43:05 +0000 (13:43 -0500)
commita21dafb09821a4b5bd0d78171cbabd86fc06fd4d
tree06210e03460527a0c7de2c2297af854f4eb29bd9
parentb048455fef67dad4ef96ce0393937322e3165b58
engines/rados: changed polling to completion callbacks methodology

Previously, getevent() function polled operations that have been submitted to check if some of them have already finished.
Now, each rados operation invokes completion callback. This callback adds to list of completed operations.
In this version getevent() only peeks if completed list has some operations.

There are two benefits:
1) small one - this works faster then previous version
2) big one - when there is a huge amount of operations in fly, getevent() might be more overloaded then producer. In this scenario some old operations are finished, but not picked up and properly noticed. This caused absurdely long execution times, when actually everything was working properly.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
engines/rados.c