6743564c0d16d85e588d5a9d80097e4690b91666 max Tue Sep 29 15:37:43 2026 -0700 hgTracks: tell the user when a track download is incomplete or still being prepared, and put the GenBank size limit under hg.conf Four things in the "Download Current Track Data" dialog, all of them about a download that quietly does the wrong thing. The api stops at a limit on how many items it will return and says so with maxItemsLimit in the reply, which the dialog ignored. Worse, a truncated reply carries two extra top level fields, maxItemsLimit and dataDownloadUrl, and the CSV/TSV converter took every top level field it did not recognise for a track: the string one was iterated one character per row, and the conversion threw before writing anything. A truncated CSV or TSV download therefore produced no file and no message at all. A track's value is always the array of its rows, so that is now the test for what is a track, rather than a list of field names that the api will keep outgrowing. All formats now say plainly that the file is incomplete, and the GenBank file carries the same warning in its COMMENT block, where it outlives the dialog. Nothing showed that anything was happening between the click and the browser's download, which is one second for two tracks and four for twenty, on a 20 kb region. The Download button now goes disabled with a line beside it while the file is prepared. It is in the button pane rather than the dialog body because the body scrolls once the track list is long. The GenBank region limit drops from 100 Mbp to 25 Mbp. 50 Mbp of chr1 with 24 tracks answers with 340 MB of track json and 50 MB of sequence, which the web browser parses, copies into the file text and copies again into the Blob, so the tab needs several times the region in memory. The limit is now the hg.conf setting maxGenbankRegion, registered in hgConfCatalog.py as a knob: the ceiling belongs to the machine and its users. It is read only when showGenbankDownload is on, and a value that is not a positive number falls back to the default rather than aborting the CGI. refs #38433 diff --git src/hg/utils/hgConfCatalog/hgConfCatalog.py src/hg/utils/hgConfCatalog/hgConfCatalog.py index f4218945345..42982f1e726 100755 --- src/hg/utils/hgConfCatalog/hgConfCatalog.py +++ src/hg/utils/hgConfCatalog/hgConfCatalog.py @@ -1170,30 +1170,49 @@ # --------------------------------------------------------------------------- LIMITS = { "what": "Caps on what one request may consume. These are the settings " "that decide whether a heavy request is answered slowly or " "refused.", "vars": [ h("maxMem", "limit", "hg/lib/hgConfig.c", public=True, verified=True, note="Address-space cap applied by cfgSetMaxMem() at CGI startup. " "Exceeding it is what produces the hogExit entries in the " "error log."), h("warnSeconds", "limit", "hg/hgTracks/hgTracks.c", verified=True, note="Log a warning for any hgTracks render slower " "than this."), + h("maxGenbankRegion", "limit", "hg/hgTracks/hgTracks.c", + default='"25000000"', verified=True, ticket="38433", + note="Bases. The largest region the \"Download Current Track Data\" " + "dialog will write as a GenBank file, which unlike its other " + "formats carries the DNA of the whole region. A ceiling is " + "needed because the file is built in the web browser rather " + "than by a CGI: a 50 Mbp region answers with 340 MB of track " + "json and 50 MB of sequence, which is parsed, copied into the " + "file text and copied again into the Blob, so the tab needs " + "several times the region in memory and can be killed by it. " + "25 Mbp measured as the point where that stays comfortable; a " + "mirror serving well provisioned desktops can raise it and a " + "GBiB should lower it, which is why it is a knob rather than a " + "number in the javascript. Read only when showGenbankDownload " + "is on, and written into the page for hgTracks.js; a value that " + "is not a positive number falls back to the default rather than " + "aborting the CGI or writing broken javascript. The javascript " + "carries the same default for a page served without the " + "setting, e.g. from a cached older hgTracks.js."), h("hubSpaceLockTimeout", "limit", "hg/lib/userdata.c", default='"300"', verified=True, ticket="37964", note="Seconds an upload will wait for another upload to the same " "hub to finish before giving up. lockHubDir takes an flock on " "hubDir/.hub.lock to serialise the hub.txt " "read-modify-write across parallel pre-finish hooks, and polls " "with LOCK_NB every 100ms rather than blocking, so one wedged " "upload cannot hold a hub indefinitely; on expiry the user is " "told to try again. The call site clamps it to 1..3600 and " "falls back to the compiled-in 300 outside that, so a " "mistyped hg.conf value cannot produce a negative or " "unbounded wait. Not marked public: hubSpace is a " "UCSC-hosted feature and its other settings are not " "documented for mirrors either."), h("maxItemsPossible", "limit", "hg/hgTracks/simpleTracks.c",