Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pybridge: Asynchronously send package files in chunks
Don't synchronously send the whole document in a single channel data block. They are often quite large (especially in `NODE_ENV=development` mode, but even in production). The synchronous send_data() blocked the bridge for too long, broke flow control, and stalled parallel package channel downloads for too long. That often led to Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING browser errors. This got aggravated a lot when going through cockpit-ssh (as it happens on our OSTree images with the cockpit/ws container), but even occasionally happened with the standard setup. Send them in 4K blocks instead, like the C bridge does. Use the same threading approach as our http-stream2 channel to avoid blocking.
- Loading branch information