9a1f31b4284285d135ddc7ccbf02e11e90983305
braney
  Tue Feb 14 13:41:44 2023 -0800
make hgCustom do the same checks as hgTracks does for suitability for
parallel loading.

diff --git src/hg/lib/customFactory.c src/hg/lib/customFactory.c
index 9634832..3108fda 100644
--- src/hg/lib/customFactory.c
+++ src/hg/lib/customFactory.c
@@ -4135,30 +4135,47 @@
     char temp[256];
     safef(temp, sizeof temp, "Timeout %d milliseconds exceeded processing %s", maxTimeInMilliseconds, pfd->track->tdb->track);
     pfd->track->networkErrMsg = cloneString(temp);
     ++errCount;
     }
 for (pfd = pfdDone; pfd; pfd = pfd->next)
     {
     // some done tracks may have errors
     if (pfd->track->networkErrMsg)
         ++errCount;
     }
 pthread_mutex_unlock( &pfdMutex );
 return errCount;
 }
 
+boolean customFactoryParallelLoad(char *bdu, char *type)
+/* Is this a data type that should be loaded in parallel ? */
+{
+return (startsWith("big", type)
+     || startsWithWord("mathWig"  , type)
+     || startsWithWord("bam"     , type)
+     || startsWithWord("halSnake", type)
+     || startsWithWord("bigRmsk", type)
+     || startsWithWord("bigLolly", type)
+     || startsWithWord("vcfTabix", type))
+     // XX code-review: shouldn't we error abort if the URL is not valid?
+     && (bdu && isValidBigDataUrl(bdu, FALSE))
+     && !(containsStringNoCase(bdu, "dl.dropboxusercontent.com"))
+     && (!startsWith("bigInteract", type))
+     && (!startsWith("bigMaf", type));
+}
+
 static struct customTrack *customFactoryParseOptionalDb(char *genomeDb, char *text,
 	boolean isFile, struct slName **retBrowserLines,
 	boolean mustBeCurrentDb, boolean doParallelLoad)
 /* Parse text into a custom set of tracks.  Text parameter is a
  * file name if 'isFile' is set.  If mustBeCurrentDb, die if custom track
  * is for some database other than genomeDb. 
  * If doParallelLoad is true, load the big tracks */
 {
 struct customTrack *trackList = NULL, *track = NULL;
 char *line = NULL;
 struct hash *chromHash = newHash(8);
 float prio = 0.0;
 struct sqlConnection *ctConn = NULL;
 char *ctConnErrMsg = NULL;
 boolean dbTrack = ctDbUseAll();
@@ -4309,31 +4326,31 @@
 		    // or placeholder for unknown file made up by customLineFile:
 		    if (startsWith(LF_BOGUS_FILE_PREFIX, lf->fileName) ||
 			sameString(CT_NO_FILE_NAME, lf->fileName))
 			fileName = "file";
 		    errAbort("Unrecognized format line %d of %s:\n\t%s (note: chrom names are case sensitive, e.g.: correct: 'chr1', incorrect: 'Chr1', incorrect: '1')",
 			lf->lineIx, fileName, emptyForNull(line));
 		    }
 		}
 	    else
 		{
 		errAbort("Unrecognized format type=%s line %d of %s",
 			 (type? type : "NULL"),
 			 (lf ? lf->lineIx : 0), (lf ? lf->fileName : "NULL file"));
 		}
 	    }
-	if (bigDataUrl && (ptMax > 0)) // handle separately in parallel so long timeouts don't accrue serially
+	if (customFactoryParallelLoad(bigDataUrl, type) && (ptMax > 0)) // handle separately in parallel so long timeouts don't accrue serially
                                        //  (unless ptMax == 0 which means turn parallel loading off)
             {
             if (doParallelLoad)
                 {
                 struct paraFetchData *pfd;
                 AllocVar(pfd);
                 pfd->track = track;  // need pointer to be stable
                 pfd->fac = fac;
                 slAddHead(&pfdList, pfd);
                 }
             oneList = track;
             }
 	else
     	    oneList = fac->loader(fac, chromHash, cpp, track, dbTrack);