Skip to content

[grid] Revert default standalone config#17060

Merged
VietND96 merged 1 commit into
trunkfrom
standalone-config
Feb 8, 2026
Merged

[grid] Revert default standalone config#17060
VietND96 merged 1 commit into
trunkfrom
standalone-config

Conversation

@VietND96
Copy link
Copy Markdown
Member

@VietND96 VietND96 commented Feb 8, 2026

🔗 Related Issues

💥 What does this PR do?

Revert the default config for Standalone has been done in PR #17015

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)
  • New feature (non-breaking change which adds functionality and tests!)
  • Breaking change (fix or feature that would cause existing functionality to change)

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
Copilot AI review requested due to automatic review settings February 8, 2026 12:55
@qodo-code-review
Copy link
Copy Markdown
Contributor

PR Type

Enhancement


Description

  • Simplify EventBus default implementation selection logic

  • Add explicit GuavaEventBus configuration to standalone mode

  • Remove conditional logic for automatic EventBus selection

  • Always use ZeroMqEventBus as default fallback implementation


File Walkthrough

Relevant files
Configuration changes
DefaultStandaloneConfig.java
Add explicit GuavaEventBus to standalone config                   

java/src/org/openqa/selenium/grid/commands/DefaultStandaloneConfig.java

  • Add explicit "events" configuration mapping to GuavaEventBus
  • Reformat "sessions" configuration for improved readability
  • Ensure standalone mode uses in-process event bus by default
+4/-1     
Refactoring
EventBusOptions.java
Simplify EventBus default selection logic                               

java/src/org/openqa/selenium/grid/server/EventBusOptions.java

  • Replace GUAVA_BUS_CLASS and ZEROMQ_BUS_CLASS constants with single
    DEFAULT_CLASS
  • Remove conditional logic that selected EventBus based on
    publish/subscribe configuration
  • Simplify createBus() method to always use ZeroMqEventBus as default
  • Remove explanatory comments about EventBus selection strategy
+2/-10   

@selenium-ci selenium-ci added B-grid Everything grid and server related C-java Java Bindings labels Feb 8, 2026
@qodo-code-review
Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #5678
🔴 Address repeated ChromeDriver instantiation causing console errors "Error: ConnectFailure
(Connection refused)" after the first instance.
🟡
🎫 #1234
🔴 Ensure click() triggers JavaScript in a link's href (regression between 2.47.1 and 2.48.x)
in Firefox.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Reinstate dynamic default event bus selection

Restore the previous, more robust logic for selecting the default event bus. The
new hardcoded default to ZeroMqEventBus can cause runtime errors if ZeroMQ
dependencies are missing; the old logic intelligently defaulted to GuavaEventBus
in such cases.

java/src/org/openqa/selenium/grid/server/EventBusOptions.java [58-60]

 private EventBus createBus() {
-  return config.getClass(EVENTS_SECTION, "implementation", EventBus.class, DEFAULT_CLASS);
+  // Determine default implementation based on EventBus configuration:
+  // - If publish/subscribe endpoints are configured: use ZeroMqEventBus (distributed mode)
+  // - Otherwise: use GuavaEventBus (standalone mode, in-process, more efficient)
+  String ZEROMQ_BUS_CLASS = "org.openqa.selenium.events.zeromq.ZeroMqEventBus";
+  String GUAVA_BUS_CLASS = "org.openqa.selenium.events.local.GuavaEventBus";
+
+  boolean hasZmqConfig =
+      config.get(EVENTS_SECTION, "publish").isPresent()
+          || config.get(EVENTS_SECTION, "subscribe").isPresent();
+  String defaultClass = hasZmqConfig ? ZEROMQ_BUS_CLASS : GUAVA_BUS_CLASS;
+  return config.getClass(EVENTS_SECTION, "implementation", EventBus.class, defaultClass);
 }
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a potential breaking change where the new default to ZeroMqEventBus could cause runtime errors for users without ZeroMQ dependencies, and it proposes reverting to the previous, safer logic.

High
General
Use class literal for event bus name

Replace the hardcoded class name string
"org.openqa.selenium.events.local.GuavaEventBus" with the safer
GuavaEventBus.class.getName() to improve maintainability and prevent potential
runtime errors from refactoring.

java/src/org/openqa/selenium/grid/commands/DefaultStandaloneConfig.java [27-28]

 Map.of(
-    "events", Map.of("implementation", "org.openqa.selenium.events.local.GuavaEventBus"),
+    "events", Map.of("implementation", org.openqa.selenium.events.local.GuavaEventBus.class.getName()),
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion improves maintainability by replacing a "magic string" with a type-safe class literal, which helps prevent runtime errors if the class is ever refactored.

Low
  • More

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to revert Selenium Grid Standalone’s default event bus configuration back to an in-process implementation, undoing a defaulting change introduced in #17015.

Changes:

  • Set Standalone’s default events.implementation to GuavaEventBus.
  • Change EventBusOptions to always default to ZeroMqEventBus when events.implementation is not explicitly configured.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
java/src/org/openqa/selenium/grid/server/EventBusOptions.java Alters the default event bus selection logic (now always defaults to ZeroMQ).
java/src/org/openqa/selenium/grid/commands/DefaultStandaloneConfig.java Forces Standalone’s default event bus implementation to Guava.

Comment thread java/src/org/openqa/selenium/grid/server/EventBusOptions.java
Comment thread java/src/org/openqa/selenium/grid/server/EventBusOptions.java
@VietND96 VietND96 merged commit a9473df into trunk Feb 8, 2026
63 checks passed
@VietND96 VietND96 deleted the standalone-config branch February 8, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-grid Everything grid and server related C-java Java Bindings Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants