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.
So, the memory leak was not a memory leak. It was a simultaneous attempt to download multiple identical extensions. This was wasteful, but it also temporarily caused a memory spike.
This does not show up in non-containerized environment because DuckDB extensions get cached in
~/.duckdb
directory. But in a containerized environment, whenever a new container starts, it has no local copy of the extensions. When combined with multiple simultaneous Describe / Truncate calls, this resulted in multiple attempts to download a (statically linked, 350 MB) Linux extension.This PR (which I will absolutely cowboy-weekend-merge without review) installs and loads
motherduck
extension on gRPC server startup, before the server is ready to accept connections.INSTALL
downloads the wrapper, andLOAD
downloads the latest extension payload. So by the time real requests come in, the extension is pre-downloaded.There can still be a similar problem if there is a running container that gets simultaneous requests right after our weekly production release, but this should recover through Fivetran's normal connector retry mechanisms.