-
Notifications
You must be signed in to change notification settings - Fork 10
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
build(deps): update Quarkus to 3.8 LTS #609
Conversation
1663eba
to
5743739
Compare
Fixed the initial JSON key-value serialization problem, but now more issues:
on the gameserver JDK 11 and 17 containers. The gameserver JDK 21, vertx, and quarkus agent test application containers seem fine somehow. |
|
|
Some quick and dirty hacking around to print out the raw response body that the Agent is seeing shows that the message body really does end prematurely:
which corresponds to (this is a manually truncated response to illustrate the point - the https response here is really complete and as normal):
so the JSON is indeed truncated, for some reason. But the equivalent HTTPie or curl requests get the same |
Comparing against the current
It looks like the current |
Here's the simple Agent patch I applied before rebuilding the gameserver containers to get this kind of debug log output: diff --git a/src/main/java/io/cryostat/agent/CryostatClient.java b/src/main/java/io/cryostat/agent/CryostatClient.java
index 4692bd6..cfc1e66 100644
--- a/src/main/java/io/cryostat/agent/CryostatClient.java
+++ b/src/main/java/io/cryostat/agent/CryostatClient.java
@@ -18,6 +18,7 @@ package io.cryostat.agent;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
@@ -53,6 +54,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import jdk.jfr.Recording;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.input.CountingInputStream;
+import org.apache.commons.io.input.TeeInputStream;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
@@ -226,7 +228,15 @@ public class CryostatClient {
})
.thenApply(
res -> {
- try (InputStream is = res.getEntity().getContent()) {
+ try (InputStream is =
+ new TeeInputStream(
+ res.getEntity().getContent(),
+ new OutputStream() {
+ @Override
+ public void write(int b) throws IOException {
+ log.info(new String(new char[] {(char) b}));
+ }
+ })) {
return mapper.readValue(is, ObjectNode.class);
} catch (IOException e) {
log.error("Unable to parse response as JSON", e); |
I'm thinking this might be the culprit: This |
Applying this Agent patch seems to solve the problem, implying that the explanation above is correct: diff --git a/src/main/java/io/cryostat/agent/CryostatClient.java b/src/main/java/io/cryostat/agent/CryostatClient.java
index 4692bd6..5556e71 100644
--- a/src/main/java/io/cryostat/agent/CryostatClient.java
+++ b/src/main/java/io/cryostat/agent/CryostatClient.java
@@ -18,6 +18,7 @@ package io.cryostat.agent;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
@@ -53,6 +54,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import jdk.jfr.Recording;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.input.CountingInputStream;
+import org.apache.commons.io.input.TeeInputStream;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
@@ -125,7 +127,9 @@ public class CryostatClient {
+ "?token="
+ pluginInfo.getToken()));
log.trace("{}", req);
- return supply(req, (res) -> logResponse(req, res)).thenApply(this::isOkStatus);
+ return supply(req, (res) -> logResponse(req, res))
+ .thenApply(this::isOkStatus)
+ .whenComplete((v, t) -> req.reset());
}
public CompletableFuture<PluginInfo> register(
@@ -174,7 +178,8 @@ public class CryostatClient {
log.error("Unable to parse response as JSON", e);
throw new RegistrationException(e);
}
- });
+ })
+ .whenComplete((v, t) -> req.reset());
} catch (JsonProcessingException e) {
return CompletableFuture.failedFuture(e);
}
@@ -209,7 +214,8 @@ public class CryostatClient {
return CompletableFuture.completedFuture(prevId);
}
return submitCredentials(prevId, credentials, callback);
- });
+ })
+ .whenComplete((v, t) -> req.reset());
}
private CompletableFuture<Integer> queryExistingCredentials(URI callback) {
@@ -226,7 +232,15 @@ public class CryostatClient {
})
.thenApply(
res -> {
- try (InputStream is = res.getEntity().getContent()) {
+ try (InputStream is =
+ new TeeInputStream(
+ res.getEntity().getContent(),
+ new OutputStream() {
+ @Override
+ public void write(int b) throws IOException {
+ log.info(new String(new char[] {(char) b}));
+ }
+ })) {
return mapper.readValue(is, ObjectNode.class);
} catch (IOException e) {
log.error("Unable to parse response as JSON", e);
@@ -254,7 +268,8 @@ public class CryostatClient {
selfMatchExpression(callback)))
.map(sc -> sc.id)
.findFirst()
- .orElse(-1));
+ .orElse(-1))
+ .whenComplete((v, t) -> req.reset());
}
private CompletableFuture<Integer> submitCredentials(
@@ -317,7 +332,8 @@ public class CryostatClient {
location.substring(
location.lastIndexOf('/') + 1, location.length());
return Integer.valueOf(id);
- });
+ })
+ .whenComplete((v, t) -> req.reset());
}
public CompletableFuture<Void> deleteCredentials(int id) {
@@ -326,7 +342,9 @@ public class CryostatClient {
}
HttpDelete req = new HttpDelete(baseUri.resolve(CREDENTIALS_API_PATH + "/" + id));
log.trace("{}", req);
- return supply(req, (res) -> logResponse(req, res)).thenApply(res -> null);
+ return supply(req, (res) -> logResponse(req, res))
+ .whenComplete((v, t) -> req.reset())
+ .thenApply(res -> null);
}
public CompletableFuture<Void> deregister(PluginInfo pluginInfo) {
@@ -341,6 +359,7 @@ public class CryostatClient {
log.trace("{}", req);
return supply(req, (res) -> logResponse(req, res))
.thenApply(res -> assertOkStatus(req, res))
+ .whenComplete((v, t) -> req.reset())
.thenApply(res -> null);
}
@@ -362,6 +381,7 @@ public class CryostatClient {
log.trace("{}", req);
return supply(req, (res) -> logResponse(req, res))
.thenApply(res -> assertOkStatus(req, res))
+ .whenComplete((v, t) -> req.reset())
.thenApply(res -> null);
} catch (JsonProcessingException e) {
return CompletableFuture.failedFuture(e);
@@ -432,20 +452,21 @@ public class CryostatClient {
.build());
req.setEntity(entityBuilder.build());
return supply(
- req,
- (res) -> {
- Instant finish = Instant.now();
- log.trace(
- "{} {} ({} -> {}): {}/{}",
- req.getMethod(),
- res.getStatusLine().getStatusCode(),
- fileName,
- req.getURI(),
- FileUtils.byteCountToDisplaySize(is.getByteCount()),
- Duration.between(start, finish));
- assertOkStatus(req, res);
- return (Void) null;
- });
+ req,
+ (res) -> {
+ Instant finish = Instant.now();
+ log.trace(
+ "{} {} ({} -> {}): {}/{}",
+ req.getMethod(),
+ res.getStatusLine().getStatusCode(),
+ fileName,
+ req.getURI(),
+ FileUtils.byteCountToDisplaySize(is.getByteCount()),
+ Duration.between(start, finish));
+ assertOkStatus(req, res);
+ return (Void) null;
+ })
+ .whenComplete((v, t) -> req.reset());
}
private HttpResponse logResponse(HttpRequestBase req, HttpResponse res) {
@@ -460,8 +481,7 @@ public class CryostatClient {
// it responds with an auth challenge, and then send the auth information we have, and use
// the client auth cache. This flow is supported for Bearer tokens in httpclient 5.
authorizationSupplier.get().ifPresent(v -> req.addHeader(HttpHeaders.AUTHORIZATION, v));
- return CompletableFuture.supplyAsync(() -> fn.apply(executeQuiet(req)), executor)
- .whenComplete((v, t) -> req.reset());
+ return CompletableFuture.supplyAsync(() -> fn.apply(executeQuiet(req)), executor);
}
private HttpResponse executeQuiet(HttpUriRequest req) { |
29714b1
to
e6ac1b0
Compare
e6ac1b0
to
f4deadc
Compare
/build_test |
Workflow started at 9/26/2024, 10:42:29 AM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: All tests pass ✅ |
Clean up labels/annotations internal representation using KeyValue type for better uniformity across API. Fix up some misuse of Blocking annotation and some bad transaction handling at startup.
f4deadc
to
e0bf7d9
Compare
/build_test |
Workflow started at 9/30/2024, 11:26:18 AM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: All tests pass ✅ |
* build(deps): update Quarkus to 3.8 LTS * add hibernate format mapper override * remove no longer necessary lazy init * disable openapi management / swagger UI unless in dev mode * remove duplicate healthcheck override * reduce healthcheck start periods * correct healthcheck URL * use authproxy image which contains wget for healthcheck * correct healthchecks for vertx agent test applications
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Related to #364
Closes #626
Description of the change:
Update Quarkus to 3.8.
Having some problems: quarkusio/quarkus#42596
Motivation for the change:
This change is helpful because users may want to...
How to manually test: