On Wed, Aug 03, 2016 at 01:57:15PM +0200, Victor Toso wrote: > Hi, > > On Wed, Aug 03, 2016 at 12:11:28PM +0200, Christophe Fergeau wrote: > > On Tue, Aug 02, 2016 at 11:48:49AM +0200, Victor Toso wrote: > > > This patch avoids a race condition. The race happens when we mark the > > > xfer-task as completed by receiving VD_AGENT_FILE_XFER_STATUS_SUCCESS > > > message while the flush callback was not yet called. > > > > > > The flush callback is file_xfer_data_flushed_cb() and it might not be > > > called immediately after data is flushed. > > > > > > The race can be verified while transferring several small files at > > > once. I can see it often with more then 50 files in one transfer > > > operation. > > > > I've also been able to reliably hit this running in valgrind. > > > > > > > > This fix implies that SpiceMainChannel should check in its async > > > callbacks if given SpiceFileTransferTask is completed. > > > > > > This patch introduces spice_file_transfer_task_is_completed (internal) > > > to help check if spice_file_transfer_task_completed() was called or > > > not. > > > > I wondered if we could cancel the pending async callbacks rather than > > doing things this way, but it's probably more complicated to do that. > > Yes, It would be more complicated. I guess this 'completed' state could > be converted to a property and we can use g_object_notify() to trigger a > the cancellation ..? We also would need to change the GCancellable in > this flush_async() function as we are using the SpiceFileTransferTask. > > Not sure if we would gain much from it but I could give it a try. I would say don't bother, unless you really want to take a look now. Christophe
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel