{"action":"created","issue":{"url":"https://api.github.com/repos/sahlberg/libnfs/issues/102","labels_url":"https://api.github.com/repos/sahlberg/libnfs/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/sahlberg/libnfs/issues/102/comments","events_url":"https://api.github.com/repos/sahlberg/libnfs/issues/102/events","html_url":"https://github.com/sahlberg/libnfs/issues/102","id":53296630,"number":102,"title":"fuse_nfs hangs when used in multithread mode","user":{"login":"varung","id":322258,"avatar_url":"https://avatars.githubusercontent.com/u/322258?v=3","gravatar_id":"","url":"https://api.github.com/users/varung","html_url":"https://github.com/varung","followers_url":"https://api.github.com/users/varung/followers","following_url":"https://api.github.com/users/varung/following{/other_user}","gists_url":"https://api.github.com/users/varung/gists{/gist_id}","starred_url":"https://api.github.com/users/varung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varung/subscriptions","organizations_url":"https://api.github.com/users/varung/orgs","repos_url":"https://api.github.com/users/varung/repos","events_url":"https://api.github.com/users/varung/events{/privacy}","received_events_url":"https://api.github.com/users/varung/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-03T06:47:35Z","updated_at":"2015-03-11T05:12:02Z","closed_at":"2015-03-11T04:12:49Z","body":"I compiled and mounted a fuse file system using fuse_nfs in the examples folder. I have a file that I created by doing \"seq\" that is 932M long. If I use libnfs directly to read this file, I'm successful. For instance, nfs_cp works fine. However, when I try to read this file using fuse_nfs, it hangs after reading some number of lines. I noticed that fuse by default uses multiple threads, and I thought that maybe this was causing the problem. It hangs after reading about \"699319\" lines from the file. I inserted logging statements, and found that nfs_pread waits indefinitely for nfs.\r\n\r\nnfs_pread async count=131072 offset=2949120 => never returns\r\n\r\nI don't understand why pread is hanging when used from fuse, but works when I run it directly. \r\n\r\nUpdate:\r\nI updated fuse_nfs to pass different arguments to fuse: \"-s\" which forces single thread. This seems to \"solve\" the problem. I guess fuse_nfs is not intended to run multithreaded. Would it be advisable to modify fuse_nfs to support multithreaded use by creating a unique nfs context for each thread?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sahlberg/libnfs/issues/comments/78206164","html_url":"https://github.com/sahlberg/libnfs/issues/102#issuecomment-78206164","issue_url":"https://api.github.com/repos/sahlberg/libnfs/issues/102","id":78206164,"user":{"login":"varung","id":322258,"avatar_url":"https://avatars.githubusercontent.com/u/322258?v=3","gravatar_id":"","url":"https://api.github.com/users/varung","html_url":"https://github.com/varung","followers_url":"https://api.github.com/users/varung/followers","following_url":"https://api.github.com/users/varung/following{/other_user}","gists_url":"https://api.github.com/users/varung/gists{/gist_id}","starred_url":"https://api.github.com/users/varung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varung/subscriptions","organizations_url":"https://api.github.com/users/varung/orgs","repos_url":"https://api.github.com/users/varung/repos","events_url":"https://api.github.com/users/varung/events{/privacy}","received_events_url":"https://api.github.com/users/varung/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T05:12:02Z","updated_at":"2015-03-11T05:12:02Z","body":"Hi\nAh I was hoping for a multithreaded implementation, not disabling mt.\n\nTo make fuse work with mt, would you recommend having a thread local\nversion of libnfs context, or wrap a mutex around the global one? Are the\nfunctions themselves thread safe(ie no static variables)?\n\nThanks\nOn Tue, Mar 10, 2015 at 9:12 PM Ronnie Sahlberg <notifications@github.com>\nwrote:\n\n> I believe this is fixed in :\n>\n> commit a5042b9\n> <https://github.com/sahlberg/libnfs/commit/a5042b9857617ea91e84f7f1949d696470183b64>\n> Author: Alexander Graf agraf@suse.de\n> Date: Sun Feb 15 01:49:22 2015 +0100\n>\n> Thanks Alexander!\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/sahlberg/libnfs/issues/102#issuecomment-78202351>.\n>\n"}}