-
Notifications
You must be signed in to change notification settings - Fork 40
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
StackOverflowError when using PrometheusOptions with startEmbeddedServer = true and -Dvertx.metrics.options.enabled=true #251
Comments
Can you please share a small reproducer with 4.5.11? I failed to create one. |
@tsegismont Here you go. Running VerticleStartup.main() throws StackOverflowError that I described above. |
tsegismont
added a commit
to tsegismont/vertx-micrometer-metrics
that referenced
this issue
Mar 5, 2025
Fixes vert-x3#251 When the embedded server is enabled, the backend registry creates an internal Vert.x instance, for the sole purpose of serving metrics data over HTTP. In general, it's not a problem because the default Vert.x options don't enable metrics. But if metrics are enabled with the vertx.metrics.options.enabled system property, the internal Vert.x instance will have metrics enabled too (because of code introduced to retrofit Vert.x builder in Vert.x 4). And then the application fail to start with a StackOverflow error (because the default PrometheusBackendRegistry is reused and reinitialized). So, we can avoid that situation by making sure the internal Vert.x instance uses dummy metrics. This problem doesn't apply to Vert.x 5. Signed-off-by: Thomas Segismont <[email protected]>
tsegismont
added a commit
to tsegismont/vertx-micrometer-metrics
that referenced
this issue
Mar 5, 2025
Fixes vert-x3#251 When the embedded server is enabled, the backend registry creates an internal Vert.x instance, for the sole purpose of serving metrics data over HTTP. In general, it's not a problem because the default Vert.x options don't enable metrics. But if metrics are enabled with the vertx.metrics.options.enabled system property, the internal Vert.x instance will have metrics enabled too (because of code introduced to retrofit Vert.x builder in Vert.x 4). And then the application fail to start with a StackOverflow error (because the default PrometheusBackendRegistry is reused and reinitialized). So, we can avoid that situation by making sure the internal Vert.x instance uses dummy metrics. This problem doesn't apply to Vert.x 5. Signed-off-by: Thomas Segismont <[email protected]>
tsegismont
added a commit
that referenced
this issue
Mar 7, 2025
Fixes #251 When the embedded server is enabled, the backend registry creates an internal Vert.x instance, for the sole purpose of serving metrics data over HTTP. In general, it's not a problem because the default Vert.x options don't enable metrics. But if metrics are enabled with the vertx.metrics.options.enabled system property, the internal Vert.x instance will have metrics enabled too (because of code introduced to retrofit Vert.x builder in Vert.x 4). And then the application fail to start with a StackOverflow error (because the default PrometheusBackendRegistry is reused and reinitialized). So, we can avoid that situation by making sure the internal Vert.x instance uses dummy metrics. This problem doesn't apply to Vert.x 5. Signed-off-by: Thomas Segismont <[email protected]>
Fixed by #254 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
4.2.6(Although it looks like all 4.. releases are impacted)
Context
Setting startEmbeddedServer to true
and passing
-Dvertx.metrics.options.enabled=true
results in StackOverFlowException. This is a fragment of the stacktrace that contains 8 stack long repeating fragment.The text was updated successfully, but these errors were encountered: