[RFC] async source3/rpc_server
David Disseldorp
ddiss at suse.de
Tue Apr 24 07:37:59 MDT 2012
Hi,
In order to properly implement a File Server Remote Shadow-copy Protocol
(MS-FSRVP) RPC server, snapshot/shadow-copy operations should be handled
asynchronously from PDU processing through to VFS request dispatch.
Working towards this, I've made a some small changes to carry two types
of RPC server command arrays (synchronous and asynchronous) under
api_struct. See pull request at the bottom of this mail.
IDLs are flagged sync or async at build time, with sync builds compiling
into the existing interface via Pidl/Samba3/ServerNDR.pm:
struct api_struct_sync {
const char *name;
uint8 opnum;
bool (*fn) (struct pipes_struct *);
};
Async builds will compile into send/recv hooks with a new
--samba3-ndr-server-async pidl option:
struct api_struct_async {
const char *name;
uint8 opnum;
struct tevent_req *(*fn_send)(TALLOC_CTX *,
struct tevent_context *,
struct pipes_struct *);
NTSTATUS (*fn_recv)(struct tevent_req *);
};
Existing synchronous server IDL will remain so for the time being.
The same code path will be shared between sync and async backends
up to the point of gen_ndr srv dispatch. i.e. api_rpcTNP for
rpc_server/srv_pipe.c.
Does this approach sound sane?
One other possibility would be to have asynchronicity defined per
operation, rather than requiring all operations to be either sync or
async for a given IDL.
Cheers, David
The following changes since commit 0d5d45c2dffbe6f630ecc8d6cab8501dc3e07214:
s4-s3upgrade: print the error message from passdb.error exceptions (2012-04-24 04:34:44 +0200)
are available in the git repository at:
git://git.samba.org/ddiss/samba.git rpc_server_async_wip
David Disseldorp (1):
source3/rpc_server: add async hooks to api_struct
pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 17 ++++++++----
source3/rpc_server/rpc_ncacn_np.c | 25 ++++++++++++------
source3/rpc_server/rpc_pipes.h | 23 ++++++++++++++--
source3/rpc_server/srv_pipe.c | 43 +++++++++++++++++++-----------
source3/rpc_server/srv_pipe_internal.h | 2 -
source3/rpc_server/srv_pipe_register.c | 24 +++-------------
source3/rpc_server/srv_pipe_register.h | 2 +-
source3/winbindd/winbindd_dual_ndr.c | 15 ++++++----
8 files changed, 90 insertions(+), 61 deletions(-)
More information about the samba-technical
mailing list