6f949e90b1ba3de976455fbcf9da21897761d134
markd
  Fri Oct 29 16:11:58 2021 -0700
add timeout option to pipeline to allow kill long-running pipelines, especially ones run from CGIs

diff --git src/hg/hgc/rnaFoldClick.c src/hg/hgc/rnaFoldClick.c
index b900ea8..79b9860 100644
--- src/hg/hgc/rnaFoldClick.c
+++ src/hg/hgc/rnaFoldClick.c
@@ -377,49 +377,49 @@
 struct dnaSeq *seq = hChromSeq(database, item->chrom, item->chromStart, item->chromEnd);
 touppers(seq->dna);
 if (item->strand[0] == '-')
     reverseComplement(seq->dna, seq->size);
 toRna(seq->dna);
 
 // make sure the dna is not longer than the paren string
 seq->dna[strlen(item->secStr)] = 0;
 
 char *rnaPlotPath = cfgOptionDefault("rnaPlotPath", "../cgi-bin/RNAplot");
 mkdirTrashDirectory(table);
 
 char psName[512];
 safef(psName, sizeof(psName), "../trash/%s/%s_%s.ps", table, table, item->name);
 char *plotCmd[] = {rnaPlotPath, NULL};
-struct pipeline *plStruct = pipelineOpen1(plotCmd, pipelineWrite | pipelineNoAbort, "/dev/null", NULL);
+struct pipeline *plStruct = pipelineOpen1(plotCmd, pipelineWrite | pipelineNoAbort, "/dev/null", NULL, 0);
 FILE *of = pipelineFile(plStruct);
 if (of != NULL)
     {
     fprintf(of, ">%s\n", psName);        /* This tells where to put file. */
     fprintf(of, "%s\n%s\n", seq->dna, item->secStr);
     }
 pipelineClose(&plStruct);
 
 char pngName[256];
 char *rootName = cloneString(psName);
  
 chopSuffix(rootName);
 safef(pngName, sizeof(pngName), "%s.png", rootName);
 
 char outputBuf[1024];
 safef(outputBuf, sizeof outputBuf, "-sOutputFile=%s", pngName);
 char *pipeCmd[] = {"gs", "-sDEVICE=png16m", outputBuf, "-dBATCH","-dNOPAUSE","-q", psName, NULL};
-struct pipeline *pl = pipelineOpen1(pipeCmd, pipelineWrite | pipelineNoAbort, "/dev/null", NULL);
+struct pipeline *pl = pipelineOpen1(pipeCmd, pipelineWrite | pipelineNoAbort, "/dev/null", NULL, 0);
 int sysRet = pipelineWait(pl);
 if (sysRet != 0)
     errAbort("System call returned %d for:\n  %s", sysRet, pipelineDesc(pl));
 
 printf("<a target=blank href='http://pseudoviewer.inha.ac.kr/WSPV_quickSender.asp?seq=%s&str=%s&start=%d'>Display on PseudoViewer</a><BR>", seq->dna, item->secStr, start);
 htmlHorizontalLine();
 printf("RNAFold diagram:<BR>");
 printf("<IMG SRC='%s' border = '2'>", pngName);
 }
 
 void htmlPrintSecStrEvofoldDrawing(FILE *f, struct rnaSecStr *item)
 {
 char fileName[512];
 struct dnaSeq *seq;
 seq = hChromSeq(database, item->chrom, item->chromStart, item->chromEnd);