On Thu, 2004-03-11 at 20:18, Robert Blayzor wrote:
> I didn't get any responses on this, so I'm trying a repost of this:
> 
> Using clamd devel-20040304 on FreeBSD 4.9
> 
> On several occasions now we've noticed that when clamd checks and reloads
> the virus database current clamdscan's hang and then time out.
> 
>

Hmm. Do you have a low level of clamd usage?

Could you try the enclosed patch, and let me know if it helps/doesn't
help?

Cheers,
-trog


--- clamd/thrmgr.c.orig 2004-03-11 21:34:08.000000000 +0000
+++ clamd/thrmgr.c      2004-03-11 21:36:28.000000000 +0000
@@ -174,13 +174,12 @@
                timeout.tv_nsec = 0;
                threadpool->thr_idle++;
                while (((job_data=work_queue_pop(threadpool->queue)) == NULL)
-                               && (threadpool->state != POOL_EXIT)) {
+                               && !must_exit) {
                        /* Sleep, awaiting wakeup */
                        retval = pthread_cond_timedwait(&(threadpool->pool_cond),
                                &(threadpool->pool_mutex), &timeout);
-                       if (retval == ETIMEDOUT) {
+                       if ((retval == ETIMEDOUT) || (threadpool->state == POOL_EXIT)) 
{
                                must_exit = TRUE;
-                               break;
                        }
                }
                threadpool->thr_idle--;

Reply via email to