[Date Prev][Date Next] [Chronological] [Thread] [Top]

Bad file number (ITS#512)



Full_Name: Danilo Poccia
Version: 1.2.9
OS: HP-UX 11.00
URL: 
Submission from: (NULL) (192.6.59.72)


I use BerkeleyDB 2.77 as the backend.

When I try to define more than 10 indexes I have an 'operations error' during an
ldapadd then uses all of that.

I have seen, using slapd with the full debug (-d 65535), than there is a 'Bad
file number' during then 11th 'ldbm_cache_open', which probably opens an already
opened file.

That function is defined in 'servers/slapd/back-ldbm/dbcache.c' and uses, as the
cache size, the MAXDBCACHE define of 'servers/slapd/back-ldbm/back-ldbm.h' which
defaults to 10.

The problems seems to happen where there are MAXDBCACHE files open by
'ldbm_cache_open' and all are used (dbc_refcnt > 0). When there is a request of
another 'cache open', a thread lock waits for a cache to be reassigned, but the
next 'ldbm_cache_open' on that file gives the 'Bad file number' error.

As as quick fix I have increased the MAXDBCACHE value to 100, a value that I
think I will not reach, but I think that a better fix can be done.

I have used both pthread and lthread (--without-threads to configure script).