a5378ba7d46c47d2c3d4b7dbdd0b7777ed7854ed braney Thu Apr 23 13:37:43 2020 -0700 using mtime to keep track of access time was resulting in a race condition in recognizing new trackDb or hub contents. This change will require that trackDb cache be on a filesystem that updates atime (e.g. /dev/shm) diff --git src/hg/lib/trackDbCache.c src/hg/lib/trackDbCache.c index e42c047..2bac54e 100644 --- src/hg/lib/trackDbCache.c +++ src/hg/lib/trackDbCache.c @@ -225,31 +225,32 @@ { cacheLog("wrong cached trackDb version %d, should be %d in %s", cachedStructVersion, TRACKDB_VERSION, addressString); continue; } *dot = 0; unsigned long address = atoi(addressString); // the name of the file is the address it uses plus TRACKDB_VERSION unsigned long size = fileSize(fileName); u_char *mem = (u_char *) mmap((void *)address, size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); cacheLog("asked for memory %lx of size %ld, got %lx",address, size, mem); if ((unsigned long)mem == address) // make sure we can get this address { u_char *ret = mem + lmBlockHeaderSize(); - maybeTouchFile(fileName); + // we're going to depend on access time working correctly + //maybeTouchFile(fileName); cacheLog("using cache memory at %lx", ret); return (struct trackDb *)ret; } cacheLog("unmapping cache memory at %lx", mem); munmap((void *)mem, size); close(fd); } cacheLog("abandoning cache search for %s", string); return NULL; } struct trackDb *trackDbCache(char *db, char *tdbPathString, time_t time) /* Check to see if this db has a cached trackDb. */