### What happened?

Hello, 

In april, I raised the issue #11881 about browser being created on selenium grid node but never used when request timeout is set.
This issue was corrected (I thought my correction was enough) but I still see the issue in an heavy loaded grid.
The point is that when requesting a new session, we do :

https://github.com/SeleniumHQ/selenium/blob/9a6947ea4fd685b5f997415565bc5dc875a71321/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java#L216

which waits for X secs (the session request timeout)

Then (this was the original bug), if the session is being created on node, we wait a bit more because session request is not in the queue anymore, but session may not be created when timeout expires

So, to correct it, I added an other wait  of 5 seconds
https://github.com/SeleniumHQ/selenium/blob/9a6947ea4fd685b5f997415565bc5dc875a71321/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java#L218

These 5 seconds were arbitrary choosen but adding some logs today, I've seen that driver creation takes more time
```
15:16:32.199 INFO [LocalDistributor.newSession] - 530153fd-a618-4418-8198-535a6c54117f: new session => start creating
15:16:38.766 INFO [LocalDistributor.newSession] - 530153fd-a618-4418-8198-535a6c54117f: new session => created
``` 
or even more
```
15:09:42.391 INFO [LocalDistributor.newSession] - 769d66eb-178a-4e45-8a8c-7f06c3f9177f: new session => start creating
15:09:51.892 INFO [LocalDistributor.newSession] - 769d66eb-178a-4e45-8a8c-7f06c3f9177f: new session => created
```
So 5 seconds is definitely not enough

A quick solution would be to increase the time on line (e.g: 15 seconds)
https://github.com/SeleniumHQ/selenium/blob/9a6947ea4fd685b5f997415565bc5dc875a71321/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java#L218

But do you think there is an other way to correct the issue ? (fixed time waits are never the best solution 😕  )
Looking at the logs (added logs can be seen here: https://github.com/bhecquet/selenium/tree/driver_sessions_staled), I think that wait time should be increased, but also, we need to prevent distributor from taking the session request once first timeout expires

### How can we reproduce the issue?

```shell
Set a grid with 1 hub, 1 node and try to create 4 browsers at the time
After some retries, a browser will be created without being used
```


### Relevant log output

```shell
>>> Client node
  WARN  2023-09-28 15:39:17,389 [TestNG-tests-1] SeleniumGridDriverFactory: Error creating driver on hub

>>> Hub
15:38:42.358 INFO [LocalNewSessionQueue.addToQueue] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: start waiting session creation
15:38:42.867 INFO [LocalDistributor.newSession] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: new session
15:38:44.400 INFO [LocalDistributor.reserveSlot] - No slots found for request bd2be918-88a3-41ef-809a-5e0c1f66ef5f and capabilities Capabilities ...
15:38:44.400 INFO [LocalDistributor.newSession] - Unable to find a free slot for request bd2be918-88a3-41ef-809a-5e0c1f66ef5f. 
...
15:39:11.001 INFO [LocalDistributor.reserveSlot] - No slots found for request bd2be918-88a3-41ef-809a-5e0c1f66ef5f and capabilities Capabilities ...
15:39:11.001 INFO [LocalDistributor.newSession] - Unable to find a free slot for request bd2be918-88a3-41ef-809a-5e0c1f66ef5f. 
15:39:11.002 WARN [SeleniumSpanExporter$1.lambda$export$1] - Will retry session bd2be918-88a3-41ef-809a-5e0c1f66ef5f
15:39:11.516 INFO [LocalDistributor.newSession] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: new session
15:39:12.361 INFO [LocalNewSessionQueue.addToQueue] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: a bit more time
15:39:12.548 INFO [LocalDistributor.reserveSlot] - No slots found for request bd2be918-88a3-41ef-809a-5e0c1f66ef5f and capabilities Capabilities {a ....
15:39:12.548 INFO [LocalDistributor.newSession] - Unable to find a free slot for request bd2be918-88a3-41ef-809a-5e0c1f66ef5f. 
15:39:12.549 WARN [SeleniumSpanExporter$1.lambda$export$1] - Will retry session bd2be918-88a3-41ef-809a-5e0c1f66ef5f
15:39:12.551 INFO [LocalDistributor.newSession] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: new session
15:39:13.580 INFO [LocalDistributor.newSession] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: new session => start creating
15:39:17.362 INFO [LocalNewSessionQueue.addToQueue] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: session not created
15:39:20.706 INFO [LocalDistributor.newSession] - bd2be918-88a3-41ef-809a-5e0c1f66ef5f: new session => created



>>> Node
15:39:13.585 INFO [LocalNode.newSession] - new session => start creating
15:39:20.695 INFO [LocalNode.newSession] - Session created by the Node. Id: 183f4330244d3d4a34a68313e7434dd9, Caps: Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 114.0.5735.199, chrome: {chromedriverVersion: 114.0.5735.90 (386bc09e8f4f..., userDataDir: C:\Users\xxx\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:63241}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: any, proxy: Proxy(autodetect), se:bidiEnabled: false, se:cdp: ws://host.comp.any..., se:cdpVersion: 114.0.5735.199, setWindowRect: true, sr:beta: false, sr:testName: login, sr:try: 0, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
```


### Operating System

Windows / Linux

### Selenium version

4.13.0

### What are the browser(s) and version(s) where you see this issue?

not related to browser

### What are the browser driver(s) and version(s) where you see this issue?

not related to browser

### Are you using Selenium Grid?

4.13.0
continue;
                }
                
                if (count.get() == 2) {
                  ImmutableCapabilities capabilities =
                      new ImmutableCapabilities("browserName", "edam");
                  try {
                    SessionId sessionId = new SessionId("123");
                    Session session =
                        new Session(
                            sessionId,
                            new URI("http:example.com"),
                            CAPS,
                            capabilities,
                            Instant.now());
                    CreateSessionResponse sessionResponse =
                        new CreateSessionResponse(
                            session,
                            JSON.toJson(
                                    ImmutableMap.of(
                                        "value",
                                        ImmutableMap.of(
                                            "sessionId", sessionId,
                                            "capabilities", capabilities)))
                                .getBytes(UTF_8));
                    queue.complete(sessionRequest.getRequestId(), Either.right(sessionResponse));
                  } catch (URISyntaxException e) {
                    throw new RuntimeException(e);
                  }
                }