Commit Graph

6 Commits

Author SHA1 Message Date
Paulo Gomes b490a6aae8 libgit2: improve known_hosts error messages
Known hosts can be a difficult problem to troubleshoot.
To make it easier for end users, the generic message has
now been changed with a much more user friendly one.

Now if a known_host is not set, an error message will be
returned, instead of it simply being ignored.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-21 20:01:29 +05:30
Paulo Gomes cea9ea9142
libgit2: improve subtransport logging
Debugging connection issues can be extremely difficult, even more so at scale or when
concurrent connections are required to trigger specific issues.

Changes:
- Add a correlation identifier for each reconciliation, which allows for greater traceability when
going through all the reconciliation operations - including at transport level.
- Add transportType to segregate HTTP and SSH transport logging.
- SSH operations are now enriched with addr containing server address, and HTTP url.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-06-13 07:35:12 +01:00
Sanskar Jaiswal 7d2bc64f47 fix panics on unmanaged http and proxy on managed http
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-05-27 14:01:23 +05:30
Sanskar Jaiswal d4beacb6ad Remove dependency on libgit2 credentials callback
Injects transport and auth options at the transport level directly to
bypass the inbuilt credentials callback because of it's several
shortcomings. Moves some of the pre-existing logic from the reconciler
to the checkout implementation.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-05-27 14:01:23 +05:30
Paulo Gomes ce92881013
libgit2: remove connection caching
Connection caching was a feature created to resolve
upstream issues raised from concurrent ssh connections.
Some scenarios were based on multiple key exchange
operations happening at the same time.

This PR removes the connection caching, and instead:
- Services Session.StdoutPipe() as soon as possible,
  as it is a known source of blocking SSH connections.
- Reuse SSH connection within the same subtransport,
  eliminating the need for new handshakes when talking
  with the same server.
- Simplifies the entire transport logic for better
  maintainability.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-05-13 11:09:02 +01:00
Paulo Gomes 92ad1f813b
Cache SSH connections
The underlying SSH connections are kept open and are reused
across several SSH sessions. This is due to upstream issues in
which concurrent/parallel SSH connections may lead to instability.

https://github.com/golang/go/issues/51926
https://github.com/golang/go/issues/27140
Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-03-28 11:58:10 +01:00