diff options
author | Jeremy Allison <jra@samba.org> | 2014-04-02 16:45:25 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-04-03 06:22:13 +0200 |
commit | 837671f47670b16726aa96ba7a0902974a1037eb (patch) | |
tree | ed199a59526ad0b1b55e0e937a502fd73fe3c10a /source3/lib/messages.c | |
parent | 5cf6e9c8520be49aa57436bf725521cdc5d160f8 (diff) | |
download | samba-837671f47670b16726aa96ba7a0902974a1037eb.tar.gz samba-837671f47670b16726aa96ba7a0902974a1037eb.tar.xz samba-837671f47670b16726aa96ba7a0902974a1037eb.zip |
s3: messages: Implement cleanup of dead records.
When a smbd process dies, pending messages.tdb records for this process
might not get cleaned up. Implement a cleanup for dead records that is
triggered after a smbd dies uncleanly; the records for that PID are
deleted.
Based on a patchset from Christof Schmitt <cs@samba.org>.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'source3/lib/messages.c')
-rw-r--r-- | source3/lib/messages.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 96b6b88a808..4ff933dc6e7 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -567,4 +567,21 @@ void messaging_dispatch_rec(struct messaging_context *msg_ctx, return; } +/* + Call when a process has terminated abnormally. +*/ +void messaging_cleanup_server(struct messaging_context *msg_ctx, + struct server_id server) +{ + if (server_id_is_disconnected(&server)) { + return; + } + + if (!procid_is_local(&server)) { + return; + } + + (void)messaging_tdb_cleanup(msg_ctx, server); + +} /** @} **/ |