Skip to content

Commit 4d660e9

Browse files
committed
Fix format
1 parent f9767e6 commit 4d660e9

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

website_and_docs/content/blog/2026/selenium-grid-4-41-deep-dive.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ description: >
1111
We are excited to ship Selenium Grid 4.41.0 — and this release brings something meaningful for you
1212
---
1313

14-
# Selenium Grid 4.41.0: What's New and Why It Matters
15-
16-
---
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.
1715

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.
2116

2217
---
2318

19+
# Selenium Grid 4.41.0: What's New and Why It Matters
20+
2421
## 1. Dynamic Grid, Now Native on Kubernetes
2522

2623
The headline feature of 4.41.0 is unambiguous: **Dynamic Grid now runs natively inside Kubernetes clusters** ([selenium#17092](https://github.com/SeleniumHQ/selenium/pull/17092), [docker-selenium#3082](https://github.com/SeleniumHQ/docker-selenium/pull/3082)).
@@ -408,23 +405,23 @@ A new [`traefik-servers-transport.yaml`](https://github.com/SeleniumHQ/docker-se
408405

409406
Three significant Distributor fixes ship in 4.41.0, addressing real concurrency issues that could manifest under load.
410407

411-
### 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))
408+
**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))**
412409

413410
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.
414411

415412
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.
416413

417-
### Fix 2: WebSocket connection counter leaks ([selenium#17106](https://github.com/SeleniumHQ/selenium/pull/17106), commit [`741fe01`](https://github.com/SeleniumHQ/selenium/commit/741fe01d276aa67a44b4a6c3590c060fd47d4f2f))
414+
**Fix 2: WebSocket connection counter leaks ([selenium#17106](https://github.com/SeleniumHQ/selenium/pull/17106), commit [`741fe01`](https://github.com/SeleniumHQ/selenium/commit/741fe01d276aa67a44b4a6c3590c060fd47d4f2f))**
418415

419416
[`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.
420417

421418
The fix tightens the lifecycle management with try-finally guards around counter decrements, backed by 406 lines of dedicated unit tests.
422419

423-
### 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))
420+
**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))**
424421

425422
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.
426423

427-
### Deadlock prevention ([selenium#17022](https://github.com/SeleniumHQ/selenium/pull/17022), commit [`a47041a`](https://github.com/SeleniumHQ/selenium/commit/a47041a5398c7465bc52cac66e3e7d198c5befb5))
424+
**Deadlock prevention ([selenium#17022](https://github.com/SeleniumHQ/selenium/pull/17022), commit [`a47041a`](https://github.com/SeleniumHQ/selenium/commit/a47041a5398c7465bc52cac66e3e7d198c5befb5))**
428425

429426
[`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.
430427

@@ -463,19 +460,19 @@ Complementing the above, the Fluxbox desktop inside every node and standalone im
463460

464461
## 7. More Improvements Worth Knowing About
465462

466-
### Unified Dynamic Grid configuration (Docker & Kubernetes) ([docker-selenium#3088](https://github.com/SeleniumHQ/docker-selenium/pull/3088), commit [`f90d1ee`](https://github.com/SeleniumHQ/docker-selenium/commit/f90d1eed07bfb6409577035f7f06528d0272ce6c))
463+
**Unified Dynamic Grid configuration (Docker & Kubernetes) ([docker-selenium#3088](https://github.com/SeleniumHQ/docker-selenium/pull/3088), commit [`f90d1ee`](https://github.com/SeleniumHQ/docker-selenium/commit/f90d1eed07bfb6409577035f7f06528d0272ce6c))**
467464

468465
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.
469466

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))
467+
**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))**
471468

472469
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.
473470

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))
471+
**Restore stereotype capability merging in RelaySessionFactory ([selenium#17097](https://github.com/SeleniumHQ/selenium/pull/17097), commit [`ac74b7e`](https://github.com/SeleniumHQ/selenium/commit/ac74b7e263e1308c3f5f8c666c8c2cb97da3e417))**
475472

476473
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.
477474

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))
475+
**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))**
479476

480477
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:
481478

@@ -493,7 +490,7 @@ Or via environment variable on any component directly:
493490
SE_PLAIN_LOGS=false
494491
```
495492

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))
493+
**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))**
497494

498495
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.
499496

@@ -507,7 +504,7 @@ The Helm chart's monitoring exporter deployment was missing `tolerations`, which
507504
# Pull latest images
508505
docker pull selenium/hub:4.41.0-20260222
509506
docker pull selenium/node-chrome:4.41.0-20260222
510-
docker pull selenium/video:ffmpeg-7.1-20260222
507+
docker pull selenium/video:ffmpeg-8.1-20260222
511508
```
512509

513510
Or update your compose file:

0 commit comments

Comments
 (0)