Skip to content

Stop using deprecated NoStackTraceThrowable in vertx-core internals - #6283

Open
jnbdz wants to merge 2 commits into
eclipse-vertx:masterfrom
SiteNetSoft:issue-5012-nostacktrace-removal
Open

Stop using deprecated NoStackTraceThrowable in vertx-core internals#6283
jnbdz wants to merge 2 commits into
eclipse-vertx:masterfrom
SiteNetSoft:issue-5012-nostacktrace-removal

Conversation

@jnbdz

@jnbdz jnbdz commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

Fixes #5012.

NoStackTraceThrowable and NoStackTraceException are @Deprecated(forRemoval = true), and 17bad9d introduced the transition path: users should catch/observe VertxException instead, with the class removal itself planned for Vert.x 6.

However vertx-core internals still instantiate NoStackTraceThrowable, so failures created from a message (Promise#fail(String), Promise#tryFail(String), Future#failedFuture(String), Completable#fail(String)) or from a null cause still surface the deprecated type at runtime.

Changes

  • Replace the internal instantiations in Completable, Promise, FailedFuture and FutureImpl with the equivalent VertxException.noStackTrace(...) factory. Message and no-stack-trace behaviour are unchanged; the runtime type broadens to VertxException (the direct superclass and the documented replacement). NoStackTraceException has no remaining usage.
  • The deprecated classes themselves are left untouched for removal in Vert.x 6, per 17bad9d. Happy to remove them in this PR instead if that is preferred for 5.2.
  • NoStackTraceTimeoutException is intentionally out of scope: it is not deprecated and must remain a java.util.concurrent.TimeoutException for the HTTP client timeout contract.
  • Tests: FutureTest now pins the failure contract (VertxException exact class, message preserved, empty stack trace) for the message/null-cause paths.
  • Additional test coverage: the shared HttpClientTimeoutTest suite now also runs over HTTP/3 (Http3ClientTimeoutTest wired through Http3Configurator) and asserts that client request timeout failures are TimeoutException instances carrying no stack trace across HTTP/1, HTTP/2 and HTTP/3. HTTP/3 tests relying on behaviours not yet available (pool saturation semantics, client re-creation from HttpClientOptions, request idle timeout on streams) are @Ignored with documented reasons.

Compatibility

Code catching VertxException (the documented replacement) is unaffected since NoStackTraceThrowable extends VertxException. Only instanceof NoStackTraceThrowable checks observe the change, which is the pattern the deprecation instructs migrating away from.

@jnbdz

jnbdz commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Re-running ECA validation after linking Eclipse and GitHub accounts.

@jnbdz
jnbdz force-pushed the issue-5012-nostacktrace-removal branch from d2d5ff9 to 4aca8c7 Compare August 6, 2026 02:01
jnbdz added 2 commits August 5, 2026 22:01
Motivation:

NoStackTraceThrowable is deprecated for removal and 17bad9d introduced
a transition path: users should observe VertxException instead. However
vertx-core internals still instantiate NoStackTraceThrowable, so failures
created from a message or a null cause still surface the deprecated type.

Changes:

Replace the internal instantiations in Completable, Promise, FailedFuture
and FutureImpl with the equivalent VertxException.noStackTrace factory.
The deprecated classes remain untouched, scheduled for removal in Vert.x 6.

Fixes eclipse-vertx#5012
Run the shared HttpClientTimeoutTest suite over HTTP/3 with the
Http3Configurator wiring and assert that client request timeout failures
are TimeoutException instances carrying no stack trace, across HTTP/1,
HTTP/2 and HTTP/3. Tests relying on behaviours not yet available over
HTTP/3 are ignored with a documented reason.
@jnbdz
jnbdz force-pushed the issue-5012-nostacktrace-removal branch from 4aca8c7 to 2cce3e4 Compare August 6, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider removing NoStackTraceThrowable and NoStackTraceException

1 participant