Skip to content

Keep the parent hook's settings in SFTPHook concurrent workers - #74209

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:sftp-worker-hooks-keep-overrides
Open

potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:sftp-worker-hooks-keep-overrides

Conversation

@potiuk

@potiuk potiuk commented Oct 4, 2026

Copy link
Copy Markdown
Member

SFTPHook.retrieve_directory_concurrently() and store_directory_concurrently() rebuilt each worker hook from ssh_conn_id alone. Anything the caller passed to the hook's constructor — remote_host, port, username, password / key file, proxy command, host key settings — was dropped, so the workers connected with the connection's defaults. A directory listed through an explicit remote_host could then be transferred from the connection's original host.

The workers are now copies of the parent hook with only the connection state reset (conn, client, the managed-connection counters and the cached host_proxy), so each worker still opens its own connection and proxy but uses the parent's effective settings.

Tests: a regression test checks that a worker hook keeps the parent's constructor overrides and connection-derived host key setting while starting with no open connection, and a parametrized test checks that both concurrent transfer paths build their workers through it.

closes: #74208


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

Worker hooks were rebuilt from ssh_conn_id alone, so constructor overrides such as remote_host, port, credentials and proxy were dropped and a directory listed through an explicit remote_host was transferred from the connection's host instead.

closes: apache#74208
Generated-by: Claude Opus 5
@seanghaeli

Copy link
Copy Markdown
Contributor

Looks like #73647 (already merged) fixes this exactly!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SFTPHook concurrent workers ignore the parent hook's constructor overrides

2 participants