Dhairya-007 commented on PR #29681:
URL: https://github.com/apache/camel/pull/29681#issuecomment-6825104207

   Both points are in, thanks — and thanks @oscerd for the independent 
walk-through of the late-close reasoning.
   
   **The `Thread.sleep` loop is gone.** You are right that no wait is needed at 
all: `Promise.promise()` has no Vert.x context, so `complete()` runs the 
registered `onSuccess(Vertx::close)` on the calling thread before it returns. 
The test is now just
   
   ```java
   // the cluster join finishes a moment after the component gave up on it. A 
context-less promise runs its
   // listeners on the completing thread, so close() has been called by the 
time complete() returns
   buildClustered.complete(recordingVertx(closed));
   
   assertTrue(closed.get(), "a Vert.x that joins the cluster after the timeout 
has to be closed again");
   ```
   
   I had added the bounded poll because I was not sure the completion was 
synchronous, which is exactly the kind of guess that turns into a flaky test. 
Good to have it pinned instead.
   
   **Upgrade guide wording** fixed: "the component `host` or `port` option is 
set and no `vertxOptions` is given", which is the real condition — `clustered` 
is only set inside the `vertxOptions == null` branch.
   
   **On the `doStop` follow-up** you flagged: agreed, `doStop` closes a Vert.x 
the component created but leaves it in the field, so a restart reuses a closed 
instance. That is pre-existing and orthogonal to the wait, so I would rather 
not widen this PR; happy to send it separately once this lands.
   
   **JIRA** — still no credentials for issues.apache.org from this environment, 
so I cannot create the ticket. If you want a `CAMEL-XXXX` on this, a committer 
creating it (or giving me the number) is all I need to retitle and amend.


-- 
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]

Reply via email to