Peter Xu <pet...@redhat.com> writes:

> On Fri, Aug 11, 2023 at 12:08:35PM -0300, Fabiano Rosas wrote:
>> When doing cleanup, we currently close() some of the shared migration
>> files and shutdown() + close() others. Be consistent by always calling
>> shutdown() before close().
>> 
>> Do this only for the source files for now because the source runs
>> multiple threads which could cause races between the two calls. Having
>> them together allows us to move them to a centralized place under the
>> protection of a lock the next patch.
>> 
>> Signed-off-by: Fabiano Rosas <faro...@suse.de>
>
> Logically I think we should only need shutdown() when we don't want to
> close immediately, or can't for some reason..  Maybe instead of adding
> shutdown()s, we can remove some?

Wouldn't shutdown() affect what the other end of the socket sees? I
thought we used shutdown() before close() as a way to end the connection
in a cleaner manner.

Reply via email to