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

Race condition with RHEL9 Podman version, Whitelists, Thresholds #296

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

Karm
Copy link
Owner

@Karm Karm commented Nov 19, 2024

There is a combination of Podman version and Java version where this piece of code hangs indefinitely:

final URLConnection c = new URL(url).openConnection();
c.setRequestProperty("Accept", "*/*");
c.setConnectTimeout(500);
try (Scanner scanner = new Scanner(c.getInputStream(), StandardCharsets.UTF_8)) {
                                    ^^^^^^^^^^^^^^^^^
   scanner.useDelimiter("\\A");
   webPage = scanner.hasNext() ? scanner.next() : "";
}

on Scanner trying to read the input stream. It seems that what used to be rather simple:

a) an exception is thrown, because Quarkus is not yet ready
b) a request response is populated in the buffer and read

is now more convoluted with some third state

c) no exception is thrown, but the buffer is not populated, Scanner hangs

I included a check for word started in the container log and that seems to alleviate this situation.

@Karm Karm self-assigned this Nov 19, 2024
@Karm Karm linked an issue Nov 19, 2024 that may be closed by this pull request
@Karm Karm requested a review from zakkak November 20, 2024 10:51
@Karm
Copy link
Owner Author

Karm commented Nov 20, 2024

Internal CI is happy too. No more hangs across crun/podman versions.

@Karm Karm changed the title Fixes race condition with certain Podman version Race condition with RHEL9 Podman version, Whitelists, Thresholds Nov 25, 2024
@zakkak zakkak merged commit 8c57183 into master Nov 25, 2024
54 checks passed
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.

Containers It hangs on RuntimesSmokeTest#quarkusEncodingIssues
2 participants