Repository: quarkusio/quarkus
Issue: VertxInputStream 10 s delay with parallel requests

### Describe the bug

I have setup reseteasy reactive POST endpoint. When sending a lot of parallel requests with a client that reuses the connection, a delay of 10 seconds sometimes can occur in VertxInputStream. The bug seems to be the following:
Assume we have two parallel requests A and B. connection is shared between A and B.
1. A and B both sets waiting = true and ends up in connection.wait() (VertxInputStream ~row 245)
2. A.endHandler is called (VertxInputStream ~row 188)
3. A.waiting == true so connection.notify() is called
4. Now, it is arbitray who will continue, assume B continues to run. This sets B.waiting = false (VertxInputStream ~row 249)
5. B.endHandler is called (VertxInputStream ~row 188)
6. B.waiting == false so connection.notify() is not called
7. The conneciton.wait() for A will not get notified and will timeout after rem (~10) seconds

The code below shows the code from the sequence above.
```java
request.endHandler(new Handler<Void>() {
    @Override
    public void handle(Void event) {
        synchronized (connection) {
            eof = true;
            if (waiting) {
                connection.notify();
            }
        }
    }
});
...
protected ByteBuf readBlocking() throws IOException {
    synchronized (request.connection()) {
        ...
        try {
            ...
            waiting = true;
            request.connection().wait(rem);
        } catch (InterruptedException e) {
            throw new InterruptedIOException(e.getMessage());
        } finally {
            waiting = false;
        }
    }
...
}
```
It works fine when not sharing the connection.

### Expected behavior

The expected behaviour is that VertxInputStream should not delay the requests like this.

### Actual behavior

Sometimes requests (that reads data with VertxInputStream) gets delayed by 10 seconds.

### How to Reproduce?

[src.zip](https://github.com/quarkusio/quarkus/files/9614315/src.zip)
The attached code shows the problem isolated. Also, the code from the description shows the core of the problem.


### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

17.0.1

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.12.2

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

7.4

### Additional information

_No response_

Changed files:
extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java

diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java
index 9e56af5b332..10717a6f0c8 100644
--- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java
+++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxInputStream.java
@@ -190,7 +190,7 @@ public void handle(Void event) {
                             synchronized (connection) {
                                 eof = true;
                                 if (waiting) {
-                                    connection.notify();
+                                    connection.notifyAll();
                                 }
                             }
                         }
@@ -212,7 +212,7 @@ public void handle(Throwable event) {
                                     }
                                 }
                                 if (waiting) {
-                                    connection.notify();
+                                    connection.notifyAll();
                                 }
                             }
                         }
diff --git a/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java b/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java
index c30afb92de7..9c56278499d 100644
--- a/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java
+++ b/independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxInputStream.java
@@ -190,7 +190,7 @@ public void handle(Void event) {
                             synchronized (connection) {
                                 eof = true;
                                 if (waiting) {
-                                    connection.notify();
+                                    connection.notifyAll();
                                 }
                             }
                         }
@@ -212,7 +212,7 @@ public void handle(Throwable event) {
                                     }
                                 }
                                 if (waiting) {
-                                    connection.notify();
+                                    connection.notifyAll();
                                 }
                             }
                         }