<<< Date Index >>>     <<< Thread Index >>>

Re: Header Cache: resource problems ???



Hello Michael,

> What is going on?  How can I get to the root cause?

The header cache opens a lock file an doesn't close it again. This
causes that you run out of file descriptors.

> How can I correct this problem?

I make a patch ready and include it in the header cache.

> What do you think?

Thank you for tracking this down! Patch attached and published. I think
dato will reproduce and verify this as soon as he has time for it. After
that it will be included in the Debian package.

Honestly,
        Thomas
diff -Nru a/hcache.c b/hcache.c
--- a/hcache.c  2004-09-20 10:12:45 +02:00
+++ b/hcache.c  2004-09-20 10:12:45 +02:00
@@ -696,6 +696,7 @@
        ret = db_env_create(&h->env, 0);
        if (ret) {
                mx_unlock_file(h->lockfile, h->fd, 0);
+               close(h->fd);
                FREE(& h);
                return NULL;
        }
@@ -706,6 +707,7 @@
                if (ret) {
                        h->env->close(h->env, 0);
                        mx_unlock_file(h->lockfile, h->fd, 0);
+                       close(h->fd);
                        FREE(& h);
                        return NULL;
                }
@@ -721,6 +723,7 @@
                h->db->close(h->db, 0);
                h->env->close(h->env, 0);
                mx_unlock_file(h->lockfile, h->fd, 0);
+               close(h->fd);
                FREE(& h);
                return NULL;
        }
@@ -741,6 +744,7 @@
        h->db->close(h->db, 0);
        h->env->close(h->env, 0);
        mx_unlock_file(h->lockfile, h->fd, 0);
+       close(h->fd);
        FREE(& h);
 }