|
From: | Krishnan Parthasarathi |
Subject: | Re: [Gluster-devel] rpc problems when using syncops in callbacks |
Date: | Mon, 29 Apr 2013 14:30:50 +0530 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Fog,
On 04/29/2013 01:57 PM, fog - wrote: If you don't provide a synctask_cbk_t to synctask_new, you are using synctask in a 'blocking' mode. That is, the thread calling synctask_new would block until the synctask_fn_t function (ie, __xattr_store_sync) returns. An alternative way to do this would be, int32_t xattr_store_sync(xlator_t *this, call_frame_t *frame, loc_t *loc, dict_t *dic) { syncstore_args args = {this, loc, dic}; return synctask_new(this->ctx->env, __xattr_store_sync, __xattr_store_sync_cbk, NULL, &args); } int32_t __xattr_store_sync_cbk (int ret, /*and the other args*/) { // Your code goes here return ret; } Now, all file operations performed using syncop_* inside __xattr_store_sync would have the synchronous flavour, while leaving the calling thread (thread calling xattr_store_sync fn) 'free'. This should avoid the hang issue. HTH, krish
|
[Prev in Thread] | Current Thread | [Next in Thread] |