Copilot commented on code in PR #6903:
URL: https://github.com/apache/incubator-kie/pull/6903#discussion_r3882018349
##########
kogito-apps-quarkus/jobs-service-quarkus/jobs-service-infinispan/src/main/java/org/kie/kogito/jobs/service/repository/infinispan/InfinispanConfiguration.java:
##########
@@ -64,6 +70,14 @@ public HealthCheck
infinispanHealthCheck(Instance<RemoteCacheManager> cacheManag
void initializeCaches(@Observes
@Priority(Interceptor.Priority.PLATFORM_BEFORE) StartupEvent startupEvent,
Instance<RemoteCacheManager> remoteCacheManager,
Event<InfinispanInitialized> initializedEvent) {
+ // ProtoStream 6 no longer indexes interface-typed marshallers by Java
class; this provider
+ // keeps Trigger-typed values resolvable (see
TriggerMarshallerProvider).
+ try {
+ MarshallerUtil.getSerializationContext(remoteCacheManager.get())
+ .registerMarshallerProvider(new
TriggerMarshallerProvider());
+ } catch (RuntimeException e) {
+ LOGGER.warn("ProtoStream SerializationContext is not available,
Trigger marshalling may not work: {}", e.getMessage());
Review Comment:
The warning logs only `e.getMessage()` and drops the stack trace, which
makes diagnosing classpath/version issues with ProtoStream/HotRod significantly
harder in production. Log the exception itself (e.g., pass `e` as the throwable
argument) while keeping the message, so operators can see the root cause. If
Trigger marshalling is required for correct operation, consider whether this
should fail fast rather than continuing in a degraded state.
##########
kogito-apps-quarkus/jobs-service-quarkus/jobs-service-common/src/main/java/org/kie/kogito/jobs/service/repository/impl/BaseReactiveJobRepository.java:
##########
@@ -43,7 +43,14 @@ protected BaseReactiveJobRepository(Vertx vertx,
JobEventPublisher jobEventPubli
public <T> CompletionStage<T> runAsync(Supplier<T> function) {
final CompletableFuture<T> future = new CompletableFuture<>();
- vertx.executeBlocking(v -> future.complete(function.get()), r -> {
+ vertx.executeBlocking(v -> {
+ try {
+ future.complete(function.get());
+ } catch (Throwable t) {
+ // without this, any failure would leave the future incomplete
and callers waiting forever
+ future.completeExceptionally(t);
+ }
+ }, r -> {
});
Review Comment:
The `executeBlocking` handler never completes or fails the Vert.x `Promise`
(`v`). With Vert.x `executeBlocking(Handler<Promise<T>> ...)`, the promise must
be completed/failed; otherwise the internal Vert.x future is left unresolved
(can cause warnings/leaks and makes cancellation/backpressure semantics
incorrect), even if you complete your own `CompletableFuture`. Prefer
completing/failing `v` directly (and then returning Vert.x's completion as a
`CompletionStage`), or call `v.complete(...)` / `v.fail(t)` in the handler and
avoid a separate `CompletableFuture`.
##########
kogito-apps-quarkus/jobs-service-quarkus/jobs-service-common/src/main/java/org/kie/kogito/jobs/service/openapi/JobServiceModelFilter.java:
##########
@@ -55,9 +57,18 @@ public class JobServiceModelFilter implements OASFilter {
@Override
public void filterOpenAPI(OpenAPI openAPI) {
+ // Since smallrye-open-api 4.2 both the components and their schemas
map can be null when the
+ // document declares no schemas (e.g. embedded job service without the
REST API).
+ Components components = openAPI.getComponents();
+ Map<String, Schema> schemas = components != null ?
components.getSchemas() : null;
+ if (schemas == null) {
+ LOGGER.warn("No component schemas are present in the OpenAPI
document, skipping job service schema adjustments.");
Review Comment:
Based on the comment, this can be an expected situation (e.g., embedded job
service without REST API). Emitting a WARN on a normal/expected startup path
may create noisy logs and false alarms. Consider lowering this to INFO/DEBUG,
or only WARN if job service endpoints are enabled but schemas are unexpectedly
missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]