ae327c5f42eddb3039d0c1b0182a61419b03c98f
angie
  Fri Dec 1 09:23:18 2023 -0800
When there is an error while loading customTracks, don't assume it's an unrecoverable file corruption problem; recently we have seen some out-of-mem and/or pthread_create issues.  Don't remove the custom track file because it may be a saved session file shared by multiple sessions and users.  Instead, ask the user to send us a session link.  refs #32627

diff --git src/hg/lib/customTrack.c src/hg/lib/customTrack.c
index d0c57b4..74dac69 100644
--- src/hg/lib/customTrack.c
+++ src/hg/lib/customTrack.c
@@ -882,42 +882,44 @@
 
 /* the 'ctfile_$db' variable contains a filename from the trash directory.
  * The file is created by hgCustom or hgTables after the custom track list
  * is created.  The filename may be reused.  The file contents are
  * custom tracks in "internal format" that have already been parsed */
 
 char *ctFileName = NULL;
 struct customTrack *ctList = NULL, *replacedCts = NULL;
 struct customTrack *nextCt = NULL;
 boolean removedCt = FALSE;
 
 /* load existing custom tracks from trash file */
 boolean changedCt = FALSE;
 if (customTracksExist(cart, &ctFileName))
     {
-    /* protect against corrupted CT trash file or table */
+    /* protect against corrupted CT trash file or table, or transient system error */
     struct errCatch *errCatch = errCatchNew();
     if (errCatchStart(errCatch))
         {
         ctList =
             customFactoryParse(genomeDb, ctFileName, TRUE, retBrowserLines);
         }
     errCatchEnd(errCatch);
     if (errCatch->gotError)
         {
-        remove(ctFileName);
-        warn("Custom track error (%s): removing custom tracks",
+        warn("Custom track loading error (%s): failed to load custom tracks. "
+             "This is an internal error. If you want us to look into it and fix your custom track, "
+             "please reach out to genome-www@soe.ucsc.edu and send us a session link "
+             "where this error occurs",
              errCatch->message->string);
         }
     errCatchFree(&errCatch);
 
     /* handle selected tracks -- update doc, remove, etc. */
     char *selectedTable = NULL;
     if (cartVarExists(cart, CT_DO_REMOVE_VAR))
         selectedTable = cartOptionalString(cart, CT_SELECTED_TABLE_VAR);
     else
         selectedTable = cartOptionalString(cart, CT_UPDATED_TABLE_VAR);
     if (selectedTable)
         {
         for (ct = ctList; ct != NULL; ct = nextCt)
             {
             nextCt = ct->next;