Repository navigation
Conversation
Uploading to GeoServer or GeoNode stored the file on CloudBench first: every chunk on disk, then a second, assembled copy (2x the file on a 10Gi volume), then the whole file read into memory to send it. Now the worker that starts an upload opens one streaming request to the target (with Content-Length) and feeds it each chunk as the browser sends it, holding at most 3 in memory; chunks landing in other gunicorn workers reach it over a Unix socket (apps/upload/relay.py). Nothing is written to disk and no Redis is needed. - A chunk sent again after a dropped connection is acknowledged, not sent twice; the browser retries for ~30s. Past the 60s idle timeout, or if the target drops, the upload starts over (targets can't resume). Pause is gone. - Checked before anything is sent: connection, workspace (GeoServer), GeoNode's upload size limit, file type, store name. - GeoNode zips go once, as zip_file, with a 1-byte stand-in base_file (GeoNode 4.x unzips zip_file only). - New endpoints /api/upload/relay...; removed the old GeoServer/GeoNode complete/start/status flow, including upload/start, which read and then deleted any path the caller gave. Also removed the unused whole-file endpoints /api/upload/complete and /api/upload. - gunicorn: gthread workers (GUNICORN_THREADS); max_requests 100000 (was 1000), as recycling a worker cuts off the uploads it relays. Design, options considered and test results: docs/dev-guide/upload-passthrough.md
GeoNode 4.x unzips only a zip sent as zip_file (with a stand-in base_file); newer GeoNodes dropped zip_file and take the zip as base_file. CloudBench connects to any GeoNode, which publishes no version, so before a zipped dataset upload it asks: a 1-byte "zip" as base_file is refused by 4.x as "No handlers found" (handler lookup comes first) and by newer GeoNodes as an invalid zip (zip check comes first). Nothing is created either way; 4.x is assumed when it can't tell. Checked on GeoHosting staging (4.x).
Closing an upload dialog (its Cancel or x) only hid it: the upload carried on. It now cancels the upload, and each upload has its own cancel flag so a cancelled one can't update a reopened dialog. An upload cancelled before its session was known ends that session too. GeoServer took a file into a store of another type (a GeoPackage into a shapefile store), replacing its files but not its type, which broke its layers while the upload said completed. Such an upload is now refused before anything is sent; a file of the store's own type still replaces its data.
deployment/upload-test runs this branch as GeoHosting runs CloudBench: production settings, 4 gthread workers, the data folder on its own volume, behind an nginx set up like its ingress (2G body, buffering, 60 s timeouts). Built on the local production image, nothing downloaded.
zamuzakki
force-pushed
the
feat/upload-passthrough
branch
from
October 15, 2026 02:38
71c6cbf to
c20f487
Compare
zamuzakki
force-pushed
the
feat/upload-passthrough
branch
from
October 22, 2026 13:01
c20f487 to
7ca8edd
Compare
GeoNode's multi-layer GeoPackage upload from main (#170) needs the whole file on disk, so GeoPackage datasets stay staged; their views now check the session is the user's and stream each layer from disk. Everything else is still relayed, and relayed datasets get their title/abstract set once GeoNode has imported them (#167).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is PR for #155
Problem
Uploads to GeoServer and GeoNode were stored on CloudBench first: the chunks, then the assembled file, then the whole file read into memory to send it. CloudBench has only a small volume (a 10Gi PVC on GeoHosting), so one big upload could fill it. CloudBench connects to any GeoServer/GeoNode, so it can't hand the file over through shared storage either.
Change
Uploads are relayed as they arrive, never stored. The browser still sends 5 MB chunks. CloudBench passes them on in one streaming request to the target, with a
Content-Length, and nothing touches its disk.gthread). The worker holding the request to the target listens on a Unix socket. The others pass their chunks to it through that socket. No Redis or other new service is needed.POST /api/upload/relaystarts an upload;PUT /api/upload/relay/<id>/chunks/<n>sends a chunk;GET/DELETE /api/upload/relay/<id>returns the status, or cancels./api/v2/upload-size-limits/).zip_filewith a stand-inbase_file; newer GeoNodes take the zip asbase_file.useChunkedUpload.GUNICORN_THREADS(default 8);GUNICORN_MAX_REQUESTS(default 100000);UPLOAD_RELAY_IDLE_TIMEOUT(60 s);UPLOAD_RELAY_RESPONSE_TIMEOUT(1800 s).Design, rejected options and known limits:
docs/dev-guide/upload-passthrough.md.Testing
deployment/upload-test/is a production-like stack: production settings, 4gthreadworkers, and an nginx set up like GeoHosting's ingress. Through it, against a GeoHosting staging GeoNode 4.4 and its GeoServer:zip_file), a GeoTIFF and a document are created;TEST_GUIDE_upload_passthrough.md.Known limits
base_fileare untested.main): GeoNode 4.4 ignores a title sent with the upload, so a dataset is titled after its file. Documents keep their title.