On Mon, Feb 05, 2024 at 04:49:28PM -0300, Fabiano Rosas wrote: > During multifd channel creation (multifd_send_new_channel_async) when > TLS is enabled, the multifd_channel_connect function is called twice, > once to create the TLS handshake thread and another time after the > asynchrounous TLS handshake has finished. > > This creates a slightly confusing call stack where > multifd_channel_connect() is called more times than the number of > channels. It also splits error handling between the two callers of > multifd_channel_connect() causing some code duplication. Lastly, it > gets in the way of having a single point to determine whether all > channel creation tasks have been initiated. > > Refactor the code to move the reentrancy one level up at the > multifd_new_send_channel_async() level, de-duplicating the error > handling and allowing for the next patch to introduce a > synchronization point common to all the multifd channel creation, > regardless of TLS. > > Signed-off-by: Fabiano Rosas <faro...@suse.de>
Reviewed-by: Peter Xu <pet...@redhat.com> -- Peter Xu