Skip to content

Commit 585e2a5

Browse files
authored
Merge pull request #49837 from gsmet/3.26.2-backports-1
[3.26] 3.26.2 backports 1
2 parents 605ed52 + a29a09b commit 585e2a5

File tree

59 files changed

+880
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+880
-349
lines changed

bom/application/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<smallrye-health.version>4.2.0</smallrye-health.version>
5252
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
5353
<smallrye-open-api.version>4.0.12</smallrye-open-api.version>
54-
<smallrye-graphql.version>2.14.0</smallrye-graphql.version>
54+
<smallrye-graphql.version>2.14.1</smallrye-graphql.version>
5555
<smallrye-fault-tolerance.version>6.9.2</smallrye-fault-tolerance.version>
5656
<smallrye-jwt.version>4.6.2</smallrye-jwt.version>
5757
<smallrye-context-propagation.version>2.2.1</smallrye-context-propagation.version>
@@ -101,7 +101,7 @@
101101
<narayana-lra.version>1.0.2.Final</narayana-lra.version>
102102
<agroal.version>2.8</agroal.version>
103103
<jboss-transaction-spi.version>8.0.0.Final</jboss-transaction-spi.version>
104-
<elasticsearch-opensource-components.version>9.1.2</elasticsearch-opensource-components.version>
104+
<elasticsearch-opensource-components.version>9.1.3</elasticsearch-opensource-components.version>
105105
<rxjava.version>2.2.21</rxjava.version>
106106
<wildfly.openssl-java.version>2.2.5.Final</wildfly.openssl-java.version>
107107
<wildfly.openssl-linux.version>2.2.2.SP01</wildfly.openssl-linux.version>

build-parent/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<!-- These properties are needed in order for them to be resolvable by the generated projects -->
2222
<compiler-plugin.version>${version.compiler.plugin}</compiler-plugin.version>
2323
<kotlin.version>2.2.10</kotlin.version>
24+
<ksp-gradle-plugin.version>2.2.10-2.0.2</ksp-gradle-plugin.version> <!-- Kotlin Symbol Processing plugin used in a test -->
2425
<dokka.version>2.0.0</dokka.version>
2526
<scala.version>2.13.12</scala.version>
2627
<scala-maven-plugin.version>4.9.5</scala-maven-plugin.version>
@@ -73,7 +74,7 @@
7374
<volume.access.modifier>:Z</volume.access.modifier>
7475

7576
<!-- Defaults for integration tests -->
76-
<elasticsearch-server.version>9.1.2</elasticsearch-server.version>
77+
<elasticsearch-server.version>9.1.3</elasticsearch-server.version>
7778
<elasticsearch.image>docker.io/elastic/elasticsearch:${elasticsearch-server.version}</elasticsearch.image>
7879
<logstash.image>docker.io/elastic/logstash:${elasticsearch-server.version}</logstash.image>
7980
<kibana.image>docker.io/elastic/kibana:${elasticsearch-server.version}</kibana.image>

core/deployment/src/main/java/io/quarkus/deployment/IsContainerRuntimeWorking.java

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Result get() {
8888

8989
boolean isAvailable = (boolean) dockerClientFactoryClass.getMethod("isDockerAvailable")
9090
.invoke(dockerClientFactoryInstance);
91-
if (!isAvailable) {
91+
if (!isAvailable && !silent) {
9292
compressor.closeAndDumpCaptured();
9393
}
9494

@@ -117,6 +117,15 @@ public Result get() {
117117
*/
118118
protected static class DockerHostStrategy implements Strategy {
119119
private static final String UNIX_SCHEME = "unix";
120+
private final boolean silent;
121+
122+
public DockerHostStrategy() {
123+
this.silent = false;
124+
}
125+
126+
public DockerHostStrategy(boolean silent) {
127+
this.silent = silent;
128+
}
120129

121130
@Override
122131
public Result get() {
@@ -136,19 +145,23 @@ public Result get() {
136145
if (Files.isWritable(dockerSocketPath)) {
137146
return Result.AVAILABLE;
138147
} else {
139-
LOGGER.warnf(
140-
"Unix socket defined in DOCKER_HOST %s is not writable, make sure Docker is running on the specified host",
141-
dockerHost);
148+
if (!silent) {
149+
LOGGER.warnf(
150+
"Unix socket defined in DOCKER_HOST %s is not writable, make sure Docker is running on the specified host",
151+
dockerHost);
152+
}
142153
}
143154
} else {
144155
try (Socket s = new Socket()) {
145156
s.connect(new InetSocketAddress(dockerHostUri.getHost(), dockerHostUri.getPort()),
146157
DOCKER_HOST_CHECK_TIMEOUT);
147158
return Result.AVAILABLE;
148159
} catch (IOException e) {
149-
LOGGER.warnf(
150-
"Unable to connect to DOCKER_HOST URI %s, make sure Docker is running on the specified host",
151-
dockerHost);
160+
if (!silent) {
161+
LOGGER.warnf(
162+
"Unable to connect to DOCKER_HOST URI %s, make sure Docker is running on the specified host",
163+
dockerHost);
164+
}
152165
}
153166
}
154167
} catch (URISyntaxException | IllegalArgumentException e) {

core/deployment/src/main/java/io/quarkus/deployment/IsDockerWorking.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ public IsDockerWorking() {
1414
}
1515

1616
public IsDockerWorking(boolean silent) {
17-
super(List.of(new TestContainersStrategy(silent), new DockerHostStrategy(), new DockerBinaryStrategy()));
17+
super(List.of(new TestContainersStrategy(silent), new DockerHostStrategy(silent), new DockerBinaryStrategy(silent)));
1818
}
1919

2020
private static class DockerBinaryStrategy implements Strategy {
21+
private final boolean silent;
22+
23+
public DockerBinaryStrategy(boolean silent) {
24+
this.silent = silent;
25+
}
26+
2127
@Override
2228
public Result get() {
23-
if (ContainerRuntimeUtil.detectContainerRuntime(false,
29+
if (ContainerRuntimeUtil.detectContainerRuntime(false, silent,
2430
ContainerRuntime.DOCKER, ContainerRuntime.PODMAN) != UNAVAILABLE) {
2531
return Result.AVAILABLE;
2632
} else {

core/deployment/src/main/java/io/quarkus/deployment/IsPodmanWorking.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ public IsPodmanWorking() {
1515
public IsPodmanWorking(boolean silent) {
1616
super(List.of(
1717
new TestContainersStrategy(silent),
18-
new DockerHostStrategy(),
19-
new PodmanBinaryStrategy()));
18+
new DockerHostStrategy(silent),
19+
new PodmanBinaryStrategy(silent)));
2020
}
2121

2222
private static class PodmanBinaryStrategy implements Strategy {
23+
private final boolean silent;
24+
25+
public PodmanBinaryStrategy(boolean silent) {
26+
this.silent = silent;
27+
}
28+
2329
@Override
2430
public Result get() {
25-
if (ContainerRuntimeUtil.detectContainerRuntime(false, ContainerRuntime.PODMAN) != UNAVAILABLE) {
31+
if (ContainerRuntimeUtil.detectContainerRuntime(false, silent, ContainerRuntime.PODMAN) != UNAVAILABLE) {
2632
return Result.AVAILABLE;
2733
} else {
2834
return Result.UNKNOWN;

core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeMain.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.net.URI;
1111
import java.net.URISyntaxException;
1212
import java.net.URL;
13+
import java.nio.file.FileSystemException;
1314
import java.nio.file.Files;
1415
import java.nio.file.Path;
1516
import java.nio.file.Paths;
@@ -26,6 +27,7 @@
2627
import io.quarkus.dev.spi.DevModeType;
2728
import io.quarkus.maven.dependency.ArtifactKey;
2829
import io.quarkus.paths.PathList;
30+
import io.smallrye.common.os.OS;
2931

3032
/**
3133
* The main entry point for the dev mojo execution
@@ -196,7 +198,18 @@ private void linkDotEnvFile() {
196198
silentDeleteFile(link);
197199
try {
198200
// create a symlink to ensure that user updates to the file have the expected effect in dev-mode
199-
Files.createSymbolicLink(link, dotEnvPath);
201+
try {
202+
Files.createSymbolicLink(link, dotEnvPath);
203+
} catch (FileSystemException e) {
204+
// on Windows fall back to hard link if symlink cannot be created (due to insufficient permissions)
205+
// see https://github.com/quarkusio/quarkus/issues/49785
206+
if (OS.WINDOWS.isCurrent()) {
207+
log.debug("Falling back to hard link on Windows after FileSystemException", e);
208+
Files.createLink(link, dotEnvPath);
209+
} else {
210+
throw e;
211+
}
212+
}
200213
} catch (IOException e) {
201214
log.warn("Unable to link .env file", e);
202215
}

core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.ArrayList;
55
import java.util.Collections;
66
import java.util.List;
7+
import java.util.concurrent.atomic.AtomicBoolean;
78
import java.util.function.Function;
89
import java.util.stream.Stream;
910

@@ -22,6 +23,7 @@ public abstract class NativeImageBuildContainerRunner extends NativeImageBuildRu
2223
protected final ContainerRuntimeUtil.ContainerRuntime containerRuntime;
2324
String[] baseContainerRuntimeArgs;
2425
private final String containerName;
26+
private final AtomicBoolean setupInvoked = new AtomicBoolean();
2527

2628
protected NativeImageBuildContainerRunner(NativeConfig nativeConfig) {
2729
this.nativeConfig = nativeConfig;
@@ -39,7 +41,10 @@ public boolean isContainer() {
3941

4042
@Override
4143
public void setup(boolean processInheritIODisabled) {
42-
if (containerRuntime != ContainerRuntimeUtil.ContainerRuntime.UNAVAILABLE) {
44+
if (containerRuntime == ContainerRuntimeUtil.ContainerRuntime.UNAVAILABLE) {
45+
return;
46+
}
47+
if (setupInvoked.compareAndSet(false, true)) {
4348
log.infof("Using %s to run the native image builder", containerRuntime.getExecutableName());
4449
// we pull the docker image in order to give users an indication of which step the process is at
4550
// it's not strictly necessary we do this, however if we don't the subsequent version command
@@ -91,6 +96,7 @@ public void setup(boolean processInheritIODisabled) {
9196
pull(effectiveBuilderImage, processInheritIODisabled);
9297
}
9398
}
99+
94100
}
95101

96102
private void pull(String effectiveBuilderImage, boolean processInheritIODisabled) {

core/deployment/src/main/java/io/quarkus/deployment/util/ContainerRuntimeUtil.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,19 @@ public static ContainerRuntime detectContainerRuntime(boolean required, Containe
5050
: List.of(ContainerRuntime.DOCKER, ContainerRuntime.PODMAN));
5151
}
5252

53+
public static ContainerRuntime detectContainerRuntime(boolean required, boolean silent,
54+
ContainerRuntime... orderToCheckRuntimes) {
55+
return detectContainerRuntime(required, silent,
56+
((orderToCheckRuntimes != null) && (orderToCheckRuntimes.length > 0)) ? Arrays.asList(orderToCheckRuntimes)
57+
: List.of(ContainerRuntime.DOCKER, ContainerRuntime.PODMAN));
58+
}
59+
5360
public static ContainerRuntime detectContainerRuntime(boolean required, List<ContainerRuntime> orderToCheckRuntimes) {
61+
return detectContainerRuntime(required, false, orderToCheckRuntimes);
62+
}
63+
64+
public static ContainerRuntime detectContainerRuntime(boolean required, boolean silent,
65+
List<ContainerRuntime> orderToCheckRuntimes) {
5466
ContainerRuntime containerRuntime = loadContainerRuntimeFromSystemProperty();
5567
if ((containerRuntime != null) && orderToCheckRuntimes.contains(containerRuntime)) {
5668
return containerRuntime;
@@ -69,7 +81,7 @@ public static ContainerRuntime detectContainerRuntime(boolean required, List<Con
6981
}
7082

7183
// we have a working container environment, let's resolve it fully
72-
containerRuntime = fullyResolveContainerRuntime(containerRuntimeEnvironment);
84+
containerRuntime = fullyResolveContainerRuntime(containerRuntimeEnvironment, silent);
7385

7486
storeContainerRuntimeInSystemProperty(containerRuntime);
7587

@@ -131,7 +143,8 @@ private static ContainerRuntime getContainerRuntimeEnvironment(List<ContainerRun
131143
return ContainerRuntime.UNAVAILABLE;
132144
}
133145

134-
private static ContainerRuntime fullyResolveContainerRuntime(ContainerRuntime containerRuntimeEnvironment) {
146+
private static ContainerRuntime fullyResolveContainerRuntime(ContainerRuntime containerRuntimeEnvironment,
147+
boolean silent) {
135148
String execName = containerRuntimeEnvironment.getExecutableName();
136149
try {
137150
return ProcessBuilder.newBuilder(execName)
@@ -174,9 +187,11 @@ private static ContainerRuntime fullyResolveContainerRuntime(ContainerRuntime co
174187
})
175188
.run();
176189
} catch (Exception e) {
177-
log.warnf("Command \"%s\" failed. "
178-
+ "Rootless container runtime detection might not be reliable or the container service is not running at all.",
179-
execName);
190+
if (!silent) {
191+
log.warnf("Command \"%s\" failed. "
192+
+ "Rootless container runtime detection might not be reliable or the container service is not running at all.",
193+
execName);
194+
}
180195
return ContainerRuntime.UNAVAILABLE;
181196
}
182197
}

core/deployment/src/main/java/io/quarkus/runner/bootstrap/StartupActionImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public StartupActionImpl(CuratedApplication curatedApplication, BuildResult buil
113113
public RunningQuarkusApplication runMainClass(String... args) throws Exception {
114114
// Start dev services that weren't started in the augmentation phase
115115
ensureDevServicesStarted();
116+
InitialConfigurator.DELAYED_HANDLER.buildTimeComplete();
116117

117118
//first we hack around class loading in the fork join pool
118119
ForkJoinClassLoading.setForkJoinClassLoader(runtimeClassLoader);
@@ -223,6 +224,7 @@ private void doClose() {
223224
public int runMainClassBlocking(String... args) throws Exception {
224225
// Start dev services that weren't started in the augmentation phase
225226
ensureDevServicesStarted();
227+
InitialConfigurator.DELAYED_HANDLER.buildTimeComplete();
226228

227229
//first we hack around class loading in the fork join pool
228230
ForkJoinClassLoading.setForkJoinClassLoader(runtimeClassLoader);
@@ -308,9 +310,6 @@ private void ensureDevServicesStarted() {
308310

309311
devServicesProperties.putAll(devServicesRegistry.getConfigForAllRunningServices());
310312
}
311-
if (InitialConfigurator.DELAYED_HANDLER.isActivated()) {
312-
InitialConfigurator.DELAYED_HANDLER.buildTimeComplete();
313-
}
314313
}
315314

316315
/**
@@ -319,6 +318,7 @@ private void ensureDevServicesStarted() {
319318
public RunningQuarkusApplication run(String... args) throws Exception {
320319
// Start dev services that weren't started in the augmentation phase
321320
ensureDevServicesStarted();
321+
InitialConfigurator.DELAYED_HANDLER.buildTimeComplete();
322322

323323
//first we hack around class loading in the fork join pool
324324
ForkJoinClassLoading.setForkJoinClassLoader(runtimeClassLoader);

0 commit comments

Comments
 (0)