Skip to main content

Distributed locking environment variables

This reference documents environment variables that configure distributed locking behavior in the Application SDK. Distributed locking uses Redis to coordinate resource access across multiple workflow instances running on different nodes.

Locking control

These variables control whether the distributed locking system is active and how it retries lock acquisition when slots are occupied.

IS_LOCKING_DISABLEDboolean
Required

Controls whether the distributed locking system is active. When true, activities with @needs_lock execute without coordination. When false, the system acquires locks before activity execution.

Default: true
Examples:
  • export IS_LOCKING_DISABLED=false
  • export IS_LOCKING_DISABLED=true

LOCK_RETRY_INTERVALinteger
Optional

Seconds to wait between lock acquisition retry attempts. When all slots are occupied, the system waits this duration before randomly selecting another slot and retrying.

Default: 5
Example:export LOCK_RETRY_INTERVAL=5

Redis connection

The Application SDK uses Redis to store and manage distributed locks. Configure your Redis connection using either standalone mode (single Redis instance) or Sentinel mode (high-availability cluster with automatic failover).

Connect directly to a single Redis instance. Use this mode for development, testing, and small-scale deployments.

REDIS_HOSTstring
Required

Redis server hostname or IP address.

Default: localhost
Examples:
  • export REDIS_HOST=localhost
  • export REDIS_HOST=redis.example.com

REDIS_PORTinteger
Optional

Redis server port number.

Default: 6379
Example:export REDIS_PORT=6379

REDIS_PASSWORDstring
Optional

Authentication password for Redis connection. The SDK sends this password during the Redis AUTH command.

Default: None
Example:export REDIS_PASSWORD='your_password'

REDIS_DBinteger
Optional

Redis database number for storing distributed lock keys. Redis supports databases 0-15 by default, providing logical keyspace separation.

Default: 0
Example:export REDIS_DB=0

See also