r9619: Fix messages_pending_for_pid actually do what it's meant to do. This might be
authorVolker Lendecke <vlendec@samba.org>
Thu, 25 Aug 2005 17:46:13 +0000 (17:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:03:23 +0000 (11:03 -0500)
a big relief on messages.tdb contention as ignoring processes with >1000
messages in printing/notify.c should work correctly now.

Jeremy, Jerry told me to ask you about printer scalability torture tests, this
might be a reason why you implemented the message_send_pid_with_timeout
using the signal (shudder) in the first place. :-)

While looking at that... Wouldn't it be better to not use the signal but have
an overall timeout for print_notify_send_messages using GetTimeOfDay & friends
and not use the alarm signal deep inside tdb.c?

Volker
(This used to be commit b5e82bb512d3425839e061e78f4d6fe0bd05b708)

source3/lib/messages.c

index 21b5531c898916f62eb79af38e6d3e1e8081ac26..7d3addd86a4d401c685552dea2fa285451bf1fcc 100644 (file)
@@ -314,7 +314,7 @@ unsigned int messages_pending_for_pid(pid_t pid)
        char *buf;
        unsigned int message_count = 0;
 
-       kbuf = message_key_pid(sys_getpid());
+       kbuf = message_key_pid(pid);
 
        dbuf = tdb_fetch(tdb, kbuf);
        if (dbuf.dptr == NULL || dbuf.dsize == 0) {