diff options
author | jp151216 <none@none> | 2008-04-11 02:54:35 -0700 |
---|---|---|
committer | jp151216 <none@none> | 2008-04-11 02:54:35 -0700 |
commit | 2b3ecdeb32aab9a01194518a0459b6515b9da9bb (patch) | |
tree | c8d5f7c658161f1a1b377f4bedf43683055b74ff | |
parent | db60a39d3edbd0819e3598d8819ac6fe576d9c27 (diff) | |
download | illumos-gate-2b3ecdeb32aab9a01194518a0459b6515b9da9bb.tar.gz |
6685218 idmapd overwhelmed by sqlite file descriptor army
-rw-r--r-- | usr/src/cmd/idmap/idmapd/dbutils.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/idmap/idmapd/idmapd.c | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/usr/src/cmd/idmap/idmapd/dbutils.c b/usr/src/cmd/idmap/idmapd/dbutils.c index d3d6d9c6c4..c1205b76b7 100644 --- a/usr/src/cmd/idmap/idmapd/dbutils.c +++ b/usr/src/cmd/idmap/idmapd/dbutils.c @@ -354,7 +354,7 @@ idmap_sqlite_busy_handler(void *arg, const char *table_name, int count) busy->sec = 2; } if (busy->total > 1000 * busy->sec) { - idmapdlog(LOG_ERR, + idmapdlog(LOG_DEBUG, "Thread %d waited %d sec for the %s database", pthread_self(), busy->sec, busy->name); busy->sec++; diff --git a/usr/src/cmd/idmap/idmapd/idmapd.c b/usr/src/cmd/idmap/idmapd/idmapd.c index a819650a45..01abe06181 100644 --- a/usr/src/cmd/idmap/idmapd/idmapd.c +++ b/usr/src/cmd/idmap/idmapd/idmapd.c @@ -187,6 +187,7 @@ int main(int argc, char **argv) { int c; + struct rlimit rl; _idmapdstate.daemon_mode = TRUE; _idmapdstate.debug_mode = FALSE; @@ -213,6 +214,19 @@ main(int argc, char **argv) exit(1); } + /* + * Raise the fd limit to max + */ + if (getrlimit(RLIMIT_NOFILE, &rl) != 0) { + idmapdlog(LOG_ERR, "getrlimit failed"); + } else if (rl.rlim_cur < rl.rlim_max) { + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_NOFILE, &rl) != 0) + idmapdlog(LOG_ERR, + "Unable to raise RLIMIT_NOFILE to %d", + rl.rlim_cur); + } + (void) mutex_init(&_svcstate_lock, USYNC_THREAD, NULL); if (_idmapdstate.daemon_mode == TRUE) { |