Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Git): Work around a bug with JGit vs MINA #9856

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

sschuberth
Copy link
Member

Also see 1 for some more background information about why SSH connections can otherwise block "if there is less entropy available than requested".

@sschuberth sschuberth requested a review from a team as a code owner January 29, 2025 10:21
@sschuberth
Copy link
Member Author

@bennati does this fix your use-case?

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.12%. Comparing base (c15996b) to head (b4f6769).
Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9856   +/-   ##
=========================================
  Coverage     68.12%   68.12%           
  Complexity     1292     1292           
=========================================
  Files           250      250           
  Lines          8840     8840           
  Branches        917      917           
=========================================
  Hits           6022     6022           
  Misses         2431     2431           
  Partials        387      387           
Flag Coverage Δ
funTest-docker 65.14% <ø> (ø)
funTest-non-docker 33.37% <ø> (ø)
test-ubuntu-24.04 35.76% <ø> (ø)
test-windows-2022 35.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -104,6 +104,9 @@ class Git(
) : VersionControlSystem() {
companion object {
init {
// Work around a bug in Apache MINA sshd, see https://github.com/eclipse-jgit/jgit/issues/135.
System.setProperty("java.security.egd", "file:/dev/./urandom")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only be executed if the OS is Linux?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done, and added an explanation to the commit message.

Also see [1] for some more background information about why SSH
connections can otherwise block "if there is less entropy available than
requested".

As a safety measure, this is only done on Linux to not cause any
unintended slow-down on Windows, also see [2].

[1]: https://stackoverflow.com/a/59097932/1127485
[2]: https://www.baeldung.com/java-security-egd#testing-the-effect-of-javasecurityegd

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth
Copy link
Member Author

Merging this early for the release as previous checks passed and only a trivial condition (famous last words) was added.

@sschuberth sschuberth merged commit 2d5e526 into main Jan 30, 2025
17 checks passed
@sschuberth sschuberth deleted the jgit-vs-mina branch January 30, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants