dbwrap: add dbwrap_parse_record_send/recv
authorRalph Boehme <slow@samba.org>
Tue, 27 Dec 2016 08:13:37 +0000 (09:13 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 18 Apr 2017 20:54:16 +0000 (22:54 +0200)
commitb3f8e9a62ce50edca54c5f31795cfd8e5f613b64
treea644baa9b3a9b9a39e6e94dc2e1f418da4a1c436
parent2813b53e1ad60bf2f055a3a6e4124aa07edc6fb4
dbwrap: add dbwrap_parse_record_send/recv

The req_state parameter tells the caller whether the async request is
blocked in a full send queue:

req_state >= DBWRAP_REQ_DISPATCHED := request is dispatched
req_state < DBWRAP_REQ_DISPATCHED := send queue is full

This is useful in a clustered Samba environment where the async dbwrap
request is sent over a socket to the local ctdbd.

If the send queue is full and the caller was issuing multiple async
dbwrap requests in a loop, the caller knows it's probably time to stop
sending requests for now and try again later.

This will be used in subsequent commits in
smbd_smb2_query_directory_send() when implementing async write time
updates. Directories may contain umpteen files so we send many requests
to ctdb without going through tevent and reading the responses which has
the potential to deadlock.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/dbwrap/dbwrap.c
lib/dbwrap/dbwrap.h
lib/dbwrap/wscript_build