Skip to content

Conversation

@ozangunalp
Copy link
Contributor

@ozangunalp ozangunalp commented Jun 18, 2025

Rebased on #47610 and still very much a draft

This targets ironing out issues from #47610 and provide a cleaner model for development of extensions providing dev services.

Instead of overloading the DevServicesResultBuildItem for discovered and to be started services, this PR creates a DevServicesRequestBuildItem. A dev services request defines, the name, the build-time config (for identification), how to start the dev service (supplier of startable), and how to extract the configuration to be injected to the app (key/supplier map).

Extensions can discover running services via ContainerLocator and CompseLocator and produce DevServicesResultBuildItem or, when they need to create a service, produce DevServicesRequestBuildItem.

Changes :

  • Rename RunningDevServicesTracker to RunningDevServicesRegistry.
  • Dev service config providers are done via a regular Map interface implemented by a supplier map.
  • Removed RunnableDevService and moved the start/reuse logic to the DevServicesRegistryBuildItem.
  • Registry handles a parent-first cross-classloader type RunningService instead of Closeable. -> see below
  • Neither DevServicesRegistryBuildItem nor DevServicesRequestBuildItem hold any state. All state is in the registry and RunningServices it holds.

Fixes with still some problems :

  • Fixes the issue in Dev UI listing of dev services when services needs to be switched. But it is not ideal. The whole service description thing needs to be seen again. This was the reason I had to introduce the RunningService.
  • Services start concurrently on forkjoin pool
  • For making the log suppressors work, I added an ugly fix to delay the completion of build time logging after the start of services. Otherwise, we start services when build time logging is completed and runtime logging is not yet started, and there are no handlers to log (and therefore suppress) the logs.

Open for discussion :
For a given DevServiceOwner, do we need to hold a bunch of services or just one ? Having one would simplify things further, ex. we can remove service directly by its owner.

Edit: Fixes #47627

@quarkus-bot quarkus-bot bot added area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/redis area/testing area/vertx labels Jun 18, 2025
@ozangunalp ozangunalp moved this to In Progress in WG - Dev Services Lifecycle Jun 18, 2025
@github-actions
Copy link

github-actions bot commented Jun 18, 2025

🎊 PR Preview 1a01fee has been successfully built and deployed to https://quarkus-pr-main-48445-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@gsmet
Copy link
Member

gsmet commented Jun 18, 2025

Quick question: does it handle the shared network config centrally? This has been quite a problem until now where we have to handle it specifically for every container (and implement it differently for each obviously :)).

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from b6d90b5 to a8afe31 Compare June 24, 2025 09:31
for (DevServicesRequestBuildItem serviceRequest : devServicesRequests) {
devServicesRegistry.start(serviceRequest);
}
// It would be nice to use the config source, but since we have the build item right there and this is a one-shot operation, just ask it instead
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment needs updating

@ozangunalp ozangunalp marked this pull request as ready for review June 24, 2025 11:14
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from 02336dd to e129b90 Compare June 25, 2025 09:36
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from 039b2ec to 0c7f6f0 Compare June 27, 2025 12:50
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from 0c7f6f0 to b67a540 Compare June 30, 2025 09:37
@quarkus-bot

This comment has been minimized.


/**
* BuildItem for running dev services.
* BuildItem for discoevered (running) or to be started dev services.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* BuildItem for discoevered (running) or to be started dev services.
* BuildItem for discovered (running) or to be started dev services.

Comment on lines 69 to 70
// We *could* get the services from the tracker, and short circuit some work. But that short circuit has some risk.
// If the matching RunningDevService was in a different classloader, we'd get a ClassCastException.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these comments are stale?

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from 83f4222 to b9c091e Compare July 1, 2025 09:37
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from b9c091e to 95994b4 Compare July 1, 2025 09:46
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@ozangunalp ozangunalp force-pushed the dev_services_simple_dev_model branch from 95994b4 to 4c4eb46 Compare July 2, 2025 15:41
@quarkus-bot

This comment has been minimized.

@holly-cummins holly-cummins force-pushed the dev_services_simple_dev_model branch from 4c4eb46 to a3faf65 Compare July 2, 2025 16:19
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 2, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit a3faf65.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@quarkus-bot
Copy link

quarkus-bot bot commented Jul 2, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit a3faf65.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
✔️ JVM Tests - JDK 17 Logs Raw logs 🚧
JVM Tests - JDK 21 Build Failures Logs Raw logs 🚧

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Tests - JDK 21 #

- Failing: devtools/cli 

📦 devtools/cli

io.quarkus.cli.config.SetConfigTest.addEncryptedConfiguration line 74 - History - More details - Source on GitHub

java.lang.RuntimeException: java.lang.NegativeArraySizeException: -98
	at io.smallrye.config.crypto.AESGCMNoPaddingSecretKeysHandler.decode(AESGCMNoPaddingSecretKeysHandler.java:44)
	at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:79)
	at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:71)
	at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
	at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
	at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:71)

@holly-cummins
Copy link
Contributor

The failure seems to be a pre-existing one:
image

@holly-cummins holly-cummins merged commit d296cdb into quarkusio:main Jul 3, 2025
59 of 60 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in WG - Dev Services Lifecycle Jul 3, 2025
@quarkus-bot quarkus-bot bot added this to the 3.25 - main milestone Jul 3, 2025
public DevServiceDescriptionBuildItem(String name, String description, ContainerInfo containerInfo,
Map<String, String> configs) {
this(name, description, () -> containerInfo, configs, null);
public DevServiceDescriptionBuildItem(String name, Supplier<ContainerInfo> lazyContainerInfo,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just as an FYI, this change broke binary compatibility. I noticed this as Quarkus LangChain4j started failing, but I was unable to find the problem until now - the problem stems from https://github.com/quarkiverse/quarkus-wiremock/blob/dd0b21d3679cbd3f86d6b73026b2754c716364b4/deployment/src/main/java/io/quarkiverse/wiremock/devservice/WireMockServerProcessor.java#L84

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's my bad. I suggest I prepare a PR to reintroduce that constructor.

Copy link
Contributor

@geoand geoand Jul 9, 2025

Choose a reason for hiding this comment

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

No problem at all. We can (and probably should) reintroduce that contructor, but that will create a source incompatibility (which admitedly is a smaller problem)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least we can still get it in for 3.25

Copy link
Contributor

Choose a reason for hiding this comment

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

👌

Copy link
Contributor

Choose a reason for hiding this comment

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

Just as an FYI, this change broke binary compatibility. I noticed this as Quarkus LangChain4j started failing, but I was unable to find the problem until now - the problem stems from https://github.com/quarkiverse/quarkus-wiremock/blob/dd0b21d3679cbd3f86d6b73026b2754c716364b4/deployment/src/main/java/io/quarkiverse/wiremock/devservice/WireMockServerProcessor.java#L84

Once again, I'm reminded that I really need to do the thing on the ecosystem CI that lists the commits that went in since the last green build. It might have made the detective work a bit easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Kafka dev services should not be started in augmentation phase

4 participants