How to Suppress Vert.x Block Logs

📘

Starting from OpenLegacy Hub version 3.0.32 and it's related core version (5.1.14+)

Suppressing Vert.x Thread Block Logs

OpenLegacy uses the Vert.x framework to run its flow engine and connectors. Vert.x is a single-threaded, non-blocking framework that logs a warning when the main thread is blocked for more than two seconds.

By default, Vert.x monitors the event loop to detect blocking operations. When the event loop is blocked beyond the default threshold, it generates warning logs to alert developers about potential performance issues. These warnings can be noisy in production environments or during legitimate long-running operations.

To change this behavior and adjust the thresholds for when warnings are triggered, you can set the following properties:

YAML Configuration

ol:
  vertx:
    max-event-loop-execute-time-seconds: 30
    warning-exception-time-seconds: 45

Configuration Details:

  • max-event-loop-execute-time-seconds: Sets the maximum time (in seconds) that the event loop is allowed to execute a task before Vert.x considers it blocked. Default is 2 seconds. Increase this value to suppress warnings for longer-running operations.
  • warning-exception-time-seconds: Sets the threshold (in seconds) at which Vert.x will log a warning exception. This should typically be equal to or greater than the max-event-loop-execute-time-seconds value.

Environment Variables

OL_VERTX_MAX_EVENT_LOOP_EXECUTE_TIME_SECONDS=30
OL_VERTX_WARNING_EXCEPTION_TIME_SECONDS=45

You can use these environment variables as an alternative to YAML configuration, which is useful for containerized deployments or when you prefer environment-based configuration management.