751a1f9fff1d6d77c2da690d1369dca64ba04fee braney Sat Sep 19 18:31:42 2026 -0700 sessionDirTester: pin how a saved session's data directory is named A saved session's custom tracks and region files are moved to a durable directory named from the user name and the session name. #10138 widened the session half of that name from 8 hex characters to 10: 8 characters of md5 is 4 billion values, and the birthday arithmetic over hundreds of thousands of sessions is not comfortable, since a collision puts one user's files in another user's session. Widening a name that is already on disk is the risky half. Directories written before the change carry the old width and their files are still in use, so the cleanup code has to be able to name both, which is why the width is a parameter rather than a constant in the middle of the function. The property pinned here is not the hash, it is that the short name is a PREFIX of the long one. That is what lets code holding the new name find a directory written under the old one, and it holds only because both come from the same md5 truncated to different lengths. Also pinned: the two-character spreading directory, the user name appearing as given, and the three calls that must abort rather than invent a path -- a relative sessionDataDir, and a width of 0 or 33. None of this is visible. A session whose directory is named differently does not report an error, it comes back without its custom track. Watched to fail and then pass: narrowing the width back to 8 turns it red on the width line. Recorded as sandbox-ab in utils/testRegistry. refs #10138, refs #38391 diff --git src/hg/lib/tests/makefile src/hg/lib/tests/makefile index 9351b8b41cd..92734650e16 100644 --- src/hg/lib/tests/makefile +++ src/hg/lib/tests/makefile @@ -14,31 +14,31 @@ ${BIN_DIR}/sessionDataTester \ ${BIN_DIR}/trashDirTester \ # ${BIN_DIR}/annoGratorTester \ ${BIN_DIR}/binTest \ ${BIN_DIR}/customTrackTester \ ${BIN_DIR}/hgvsTester \ ${BIN_DIR}/sqlCheck ${BIN_DIR}/%: %.c ${MYLIBS} @${MKDIR} ${BIN_DIR} ${CC} ${CC_PROG_OPTS} -o $@ $*.c ${MYLIBS} $L #test: binTest spDbTest hdbTest genePredTest pslReaderTest annoGratorTest customTrackTest hgvsTest test: binTest quickLiftTest sessionDataTest trashDirTest mallocTopPadTest bedItemRgbTest \ hVarSubstHtmlTest dataVersionPathTest genarkLiftOverTest \ - snapshotTypeTest spDbTest hdbTest genePredTest pslReaderTest customTrackTest hgvsTest + snapshotTypeTest sessionDirTest spDbTest hdbTest genePredTest pslReaderTest customTrackTest hgvsTest rm -r output echo tested all mkdirs: @${MKDIR} output ${BIN_DIR} loaders: ln -sf ${CGI_BIN}/loader . spDbTest: ${BIN_DIR}/spDbTest mkdirs ${BIN_DIR}/spDbTest sp121210 Q9FFH7 > output/spDbTest ${BIN_DIR}/spDbTest sp121210 P29312 >> output/spDbTest diff expected/spDbTest output/spDbTest hdbTest: ${BIN_DIR}/hdbTest mkdirs @@ -129,21 +129,26 @@ dataVersionPathTest: mkdirs ${CC} ${CC_PROG_OPTS} -o ${BIN_DIR}/dataVersionPathTester dataVersionPathTester.c ${MYLIBS} $L ${BIN_DIR}/dataVersionPathTester > output/dataVersionPathTest diff expected/dataVersionPathTest output/dataVersionPathTest genarkLiftOverTest: mkdirs ${CC} ${CC_PROG_OPTS} -o ${BIN_DIR}/genarkLiftOverTester genarkLiftOverTester.c ${MYLIBS} $L ${BIN_DIR}/genarkLiftOverTester > output/genarkLiftOverTest diff expected/genarkLiftOverTest output/genarkLiftOverTest snapshotTypeTest: mkdirs ${CC} ${CC_PROG_OPTS} -o ${BIN_DIR}/snapshotTypeTester snapshotTypeTester.c ${MYLIBS} $L ${BIN_DIR}/snapshotTypeTester > output/snapshotTypeTest diff expected/snapshotTypeTest output/snapshotTypeTest +sessionDirTest: mkdirs + ${CC} ${CC_PROG_OPTS} -o ${BIN_DIR}/sessionDirTester sessionDirTester.c ${MYLIBS} $L + ${BIN_DIR}/sessionDirTester > output/sessionDirTest + diff expected/sessionDirTest output/sessionDirTest + sqlCheck: ${BIN_DIR}/sqlCheck mkdirs ${MAKE} -f sqlCheck.mk test BIN_DIR=${BIN_DIR} OUT_DIR=output clean: rm -rf *.o bin output *.tmp loader udcCache