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/hgGene/rnaStructure.c src/hg/hgGene/rnaStructure.c index 59ee699..e3327ed 100644 --- src/hg/hgGene/rnaStructure.c +++ src/hg/hgGene/rnaStructure.c @@ -81,31 +81,31 @@ bool plotDone = FALSE; if (fileExists(psName)) plotDone = TRUE; else { FILE *f; if (!fileExists(rnaPlotPath)) { plotDone = FALSE; fprintf(stderr, "Could not find %s", rnaPlotPath); } else { 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); f = pipelineFile(plStruct); if (f != NULL) { fprintf(f, ">%s\n", psName); /* This tells where to put file. */ fprintf(f, "%s\n%s\n", fold.seq, fold.fold); plotDone = TRUE; } pipelineClose(&plStruct); } } // newer versions of RNAplot add _ss.ps to the file name if (!fileExists(psName)) safef(psName, sizeof(psName), "../trash/%s/%s_%s.ps_ss.ps", table, table, geneId); @@ -216,35 +216,35 @@ else if (sameString(how, "picture")) { char *psFile = cartString(cart, hggMrnaFoldPs); char *rootName = cloneString(psFile); char pngName[256]; char pdfName[256]; chopSuffix(rootName); safef(pngName, sizeof(pngName), "%s.png", rootName); safef(pdfName, sizeof(pngName), "%s.pdf", rootName); hPrintf("<H2>%s (%s) %s energy %1.2f</H2>\n", geneName, geneId, table, fold->energy); if (!fileExists(pdfName)) { char *command[] = { "ps2pdf", psFile, pdfName, NULL}; - struct pipeline *pl = pipelineOpen1(command, pipelineWrite | pipelineNoAbort, "/dev/null", NULL); + struct pipeline *pl = pipelineOpen1(command, pipelineWrite | pipelineNoAbort, "/dev/null", NULL, 0); int sysRet = pipelineWait(pl); if (sysRet != 0) errAbort("System call returned %d for:\n %s", sysRet, pipelineDesc(pl)); } hPrintf("Click <A HREF=\"%s\">here for PDF version</A><BR>", pdfName); if (!fileExists(pngName)) { char outputBuf[1024]; safef(outputBuf, sizeof outputBuf, "-sOutputFile=%s", pngName); char *command[] = { "gs","-sDEVICE=png16m", outputBuf,"-dBATCH","-dNOPAUSE","-q", psFile, NULL}; - struct pipeline *pl = pipelineOpen1(command, pipelineWrite | pipelineNoAbort, "/dev/null", NULL); + struct pipeline *pl = pipelineOpen1(command, pipelineWrite | pipelineNoAbort, "/dev/null", NULL, 0); int sysRet = pipelineWait(pl); if (sysRet != 0) errAbort("System call returned %d for:\n %s", sysRet, pipelineDesc(pl)); } hPrintf("<IMG SRC=\"%s\">", pngName); } }