You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website_and_docs/content/blog/2026/selenium-grid-4-41-deep-dive.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,8 @@ description: >
11
11
We are excited to ship Selenium Grid 4.41.0 — and this release brings something meaningful for you
12
12
---
13
13
14
-
# Selenium Grid 4.41.0: What's New and Why It Matters
14
+
We are excited to ship Selenium Grid **4.41.0** 🎉 — and this might be one of impactful releases in recent memory. Whether you are running Grid in a bare-metal lab, a Docker Compose stack, or a sprawling Kubernetes cluster, this release brings something meaningful for you. From a brand-new **Dynamic Grid for Kubernetes**, a powerful **Session Event API**, to smarter video recording and a rock-solid Distributor, let's dig in.
15
15
16
-
---
17
-
18
-
## Overview
19
-
20
-
We are excited to ship Selenium Grid **4.41.0** — and this might be one of impactful releases in recent memory. Whether you are running Grid in a bare-metal lab, a Docker Compose stack, or a sprawling Kubernetes cluster, this release brings something meaningful for you. From a brand-new **Dynamic Grid for Kubernetes**, a powerful **Session Event API**, to smarter video recording and a rock-solid Distributor, let's dig in.
21
16
22
17
---
23
18
@@ -408,23 +403,23 @@ A new [`traefik-servers-transport.yaml`](https://github.com/SeleniumHQ/docker-se
408
403
409
404
Three significant Distributor fixes ship in 4.41.0, addressing real concurrency issues that could manifest under load.
**Fix 1: Thread exhaustion in health-check cycle ([selenium#17104](https://github.com/SeleniumHQ/selenium/pull/17104), commit [`d8195c8`](https://github.com/SeleniumHQ/selenium/commit/d8195c8aa617c54d191523a5210f972978965b93))**
412
407
413
408
The `LocalDistributor` runs periodic health checks against all registered nodes. Under high node counts, a subtle bug caused the health-check executor thread pool to accumulate tasks faster than they were being consumed, eventually exhausting threads and causing new session requests to stall.
414
409
415
410
The fix refactors [`LocalNodeRegistry.java`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/src/org/openqa/selenium/grid/distributor/local/LocalNodeRegistry.java) to decouple the health-check scheduling from the main distribution path, with 295 lines of new tests specifically exercising concurrent health-check scenarios.
[`ProxyNodeWebsockets`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/src/org/openqa/selenium/grid/node/ProxyNodeWebsockets.java) tracks active WebSocket connections per node to respect `maxSessions`. A race condition in the connection bookkeeping could cause the counter to drift upward, making slots appear occupied when they were free. Over time this would cause nodes to appear artificially full.
420
415
421
416
The fix tightens the lifecycle management with try-finally guards around counter decrements, backed by 406 lines of dedicated unit tests.
**Fix 3: Retry session on executor shutdown ([selenium#17109](https://github.com/SeleniumHQ/selenium/pull/17109), commit [`527a40b`](https://github.com/SeleniumHQ/selenium/commit/527a40b30f01b272c1b7df1de122f8b16e3f79ce))**
424
419
425
420
When a [`RemoteNode`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java)'s thread executor enters a shutdown state (e.g., during a graceful drain), session creation requests could be silently dropped instead of being returned to the queue for redistribution. The Distributor now detects `RejectedExecutionException` from a shutting-down executor and transparently retries the session on another available node.
[`LocalGridModel`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/src/org/openqa/selenium/grid/distributor/local/LocalGridModel.java) contained a lock inversion risk between its internal state lock and the event bus listener lock. Under specific timing conditions this could deadlock the Distributor entirely. The fix restructures lock acquisition order with a dedicated test ([`LocalGridModelDeadlockTest.java`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/test/org/openqa/selenium/grid/distributor/local/LocalGridModelDeadlockTest.java), 275 lines) that explicitly reproduces the hazard.
430
425
@@ -455,27 +450,27 @@ This makes docker-selenium the go-to tool whenever you need to:
455
450
- Run a cross-version compatibility sweep in CI across a range of browser versions in parallel
456
451
- Pin a version in a test environment and guarantee it never changes until you deliberately upgrade
457
452
458
-
### Interactive debugging with Fluxbox browser menu ([docker-selenium#3085](https://github.com/SeleniumHQ/docker-selenium/pull/3085), commit [`bc1e6fd`](https://github.com/SeleniumHQ/docker-selenium/commit/bc1e6fda1cfbdd32e91ef3699e92d9044b3086ae))
453
+
**Interactive debugging with Fluxbox browser menu ([docker-selenium#3085](https://github.com/SeleniumHQ/docker-selenium/pull/3085), commit [`bc1e6fd`](https://github.com/SeleniumHQ/docker-selenium/commit/bc1e6fda1cfbdd32e91ef3699e92d9044b3086ae))**
459
454
460
455
Complementing the above, the Fluxbox desktop inside every node and standalone image now has a right-click menu with browser launchers and a lightweight terminal (xterm). Connect to the container via VNC or noVNC, right-click the desktop, and launch the browser directly — no command line needed. When you are debugging a test failure visually against a specific image version, this removes the last friction from the interactive workflow.
Configuration environment variables are now shared across [`NodeDocker`](https://github.com/SeleniumHQ/docker-selenium/tree/4.41.0-20260222/NodeDocker), [`StandaloneDocker`](https://github.com/SeleniumHQ/docker-selenium/tree/4.41.0-20260222/StandaloneDocker), [`NodeKubernetes`](https://github.com/SeleniumHQ/docker-selenium/tree/4.41.0-20260222/NodeKubernetes), and [`StandaloneKubernetes`](https://github.com/SeleniumHQ/docker-selenium/tree/4.41.0-20260222/StandaloneKubernetes) images. Variables like `SE_NODE_GRID_URL`, `SE_NODE_MAX_SESSIONS`, and video-related settings behave identically regardless of whether the Dynamic Grid backend is Docker or Kubernetes.
469
464
470
-
### Basic auth support in Dynamic Grid Standalone ([selenium#17072](https://github.com/SeleniumHQ/selenium/pull/17072), commit [`7278252`](https://github.com/SeleniumHQ/selenium/commit/7278252badc14d9d036df8ca20d6927b5f546a49))
465
+
**Basic auth support in Dynamic Grid Standalone ([selenium#17072](https://github.com/SeleniumHQ/selenium/pull/17072), commit [`7278252`](https://github.com/SeleniumHQ/selenium/commit/7278252badc14d9d036df8ca20d6927b5f546a49))**
471
466
472
467
When Grid Standalone is secured with HTTP basic auth, [`DockerSessionFactory`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/src/org/openqa/selenium/grid/node/docker/DockerSessionFactory.java) now correctly forwards credentials when communicating with the node's own status endpoint during session setup. A small but important fix that unblocks secured Dynamic Grid deployments.
473
468
474
-
### Restore stereotype capability merging in RelaySessionFactory ([selenium#17097](https://github.com/SeleniumHQ/selenium/pull/17097), commit [`ac74b7e`](https://github.com/SeleniumHQ/selenium/commit/ac74b7e263e1308c3f5f8c666c8c2cb97da3e417))
469
+
**Restore stereotype capability merging in RelaySessionFactory ([selenium#17097](https://github.com/SeleniumHQ/selenium/pull/17097), commit [`ac74b7e`](https://github.com/SeleniumHQ/selenium/commit/ac74b7e263e1308c3f5f8c666c8c2cb97da3e417))**
475
470
476
471
A regression introduced in a prior release caused [`RelaySessionFactory`](https://github.com/SeleniumHQ/selenium/blob/selenium-4.41.0/java/src/org/openqa/selenium/grid/node/relay/RelaySessionFactory.java) to ignore stereotype capabilities during session creation, which broke mobile relay sessions that relied on custom capabilities from the stereotype being merged into the session request. Restored and covered by 156 lines of new tests.
477
472
478
-
### Kubernetes: structured logs support ([docker-selenium#3087](https://github.com/SeleniumHQ/docker-selenium/pull/3087), commit [`ccd697c`](https://github.com/SeleniumHQ/docker-selenium/commit/ccd697cef2b13904c628b5d968447df1e7c30ed4))
473
+
**Kubernetes: structured logs support ([docker-selenium#3087](https://github.com/SeleniumHQ/docker-selenium/pull/3087), commit [`ccd697c`](https://github.com/SeleniumHQ/docker-selenium/commit/ccd697cef2b13904c628b5d968447df1e7c30ed4))**
479
474
480
475
Structured logging (`global.seleniumGrid.structuredLogs`) already existed, but plain-text logs were always emitted alongside it with no way to suppress them. This PR adds `SE_PLAIN_LOGS` (`--plain-logs`, default `true`) as an independent toggle. Both modes can run simultaneously — to get pure JSON output for a log aggregation pipeline (Loki, Elasticsearch), enable structured logs and turn plain logs off:
481
476
@@ -493,7 +488,7 @@ Or via environment variable on any component directly:
493
488
SE_PLAIN_LOGS=false
494
489
```
495
490
496
-
### Kubernetes: tolerations fix for monitoring exporter ([docker-selenium#3086](https://github.com/SeleniumHQ/docker-selenium/pull/3086), commit [`56e0192`](https://github.com/SeleniumHQ/docker-selenium/commit/56e0192c))
491
+
**Kubernetes: tolerations fix for monitoring exporter ([docker-selenium#3086](https://github.com/SeleniumHQ/docker-selenium/pull/3086), commit [`56e0192`](https://github.com/SeleniumHQ/docker-selenium/commit/56e0192c))**
497
492
498
493
The Helm chart's monitoring exporter deployment was missing `tolerations`, which caused it to fail scheduling on tainted nodes (a common pattern in production clusters with dedicated node pools). This is now fixed.
499
494
@@ -507,7 +502,7 @@ The Helm chart's monitoring exporter deployment was missing `tolerations`, which
0 commit comments