GNOME Bugzilla – Bug 733133
Hang enumerating large directory
Last modified: 2014-07-17 16:50:30 UTC
I can reproduce a hang about 20% of the time when enumerating a directory with 10000 files on one of my machines. All the threads in the afp backend appear to be idle, but presumably there is some race condition. I will debug it further.
Created attachment 280605 [details] [review] afp: Fix race between writing and reading The following sequence of events is possible in GVfsAfpConnection: send_request_unlocked write_dsi_header_cb ... return to main loop ... read_dsi_header_cb write_command_cb This happens if the server sends its response before the main loop gets a chance to run since write_command_cb is executed asynchronously as an idle function. It causes the job to hang because the request is only stored in the request hash table in write_command_cb and so the response is ignored when being processed because it cannot find the corresponding request. To fix this, store the request in the hash table before the request is written.
Well that was fun to debug :-)
Review of attachment 280605 [details] [review]: I haven't change to test it, but makes sense. Thanks for debugging!
Pushed to master as 66582af10b29f5a94a8d437173ae396bbce84406. I thought I'd get it in before 3.13.4 for some extra testing. Thanks for the review.