Merge branch 'ia' into ia-zak

This commit is contained in:
Matt
2015-09-12 09:12:18 -06:00
3 changed files with 10 additions and 6 deletions

@ -369,7 +369,7 @@ bool Conf::init ( char *dir ) { // , int32_t hostId ) {
g_conf.m_forceIt = false;
// always turn on threads if live
if ( g_conf.m_isLive ) g_conf.m_useThreads = true;
//if ( g_conf.m_isLive ) g_conf.m_useThreads = true;
// disable this at startup always... no since might have crashed
// in the middle of a test. and we just turn on spiders again when
// already in test mode otherwise hostid #0 will erase all the files.

@ -1295,12 +1295,13 @@ void RdbMap::reduceMemFootPrint () {
for ( ; s && *s && ! is_digit(*s) ; s++ );
int id = 0;
if ( s ) id = atoi(s);
if ( id && (id % 2) == 0 ) return;
// id can be zero like for spiderdb0000.map
if ( (id % 2) == 0 ) return;
// log("map: reducing mem footprint for %s/%s",
// m_file.getDir(),
// m_file.getFilename());
// log("map: reducing mem footprint for %s/%s",
// m_file.getDir(),
// m_file.getFilename());
// seems kinda buggy now..
m_reducedMem = true;
//return;

@ -927,9 +927,12 @@ void handleRequest54 ( UdpSlot *udpSlot , int32_t niceness ) {
// and the loadbucket id
//*(int32_t *)p = bb.m_id; p += 4;
int32_t sanityCount = s_loadTable.getNumSlots();
// now remove old entries from the load table. entries that
// have completed and have a download end time more than 10 mins ago
for ( int32_t i = 0 ; i < s_loadTable.getNumSlots() ; i++ ) {
if ( sanityCount-- < 0 ) break;
// skip if empty
if ( ! s_loadTable.m_flags[i] ) continue;
// get the bucket