Repository navigation
Conversation
TransactionExecutor connected with the session's original config, so multi-statement scripts, gt, BEGIN and (with the process worker off) every query went straight to the database host and skipped the tunnel. It now reuses the session's tunnel, or opens and closes its own. Also fix the SSH test container: the init script edited the template sshd_config instead of /config/sshd/sshd_config, and the tunnel mod is skipped when lscr.io is unreachable, leaving AllowTcpForwarding off. Refs #337
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.
Multi-statement scripts, gt and BEGIN (and every query when the process worker is off) opened a fresh connection from the original config, so they tried to reach the database host directly instead of going through the SSH tunnel. The transaction executor now reuses the session's tunnel, or opens and closes its own when there isn't one.
Reproduced and verified against the docker SSH bastion + postgres-ssh setup: all four paths failed with "could not translate host name" before, and all go through the tunnel's local port now. gt also keeps session state between statements over SSH.
Also fixes the SSH test container, which never actually had TCP forwarding enabled: the init script edited the template config instead of the one sshd runs with, and the tunnel mod gets skipped when lscr.io can't be reached.
Refs #337. Running a batch on one connection without BEGIN/COMMIT, the other thing asked for there, isn't part of this.