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
When there are pending events in Redis waiting to be processed, the following issue occurs during application startup:
The event-bus-redis module is loaded, and the bullWorker begins processing the events automatically.
Custom subscribers are loaded after.
As a result, the subscribers log messages such as Processing XXX which has 0 subscribers and mark these events as completed without proper handling.
A common scenario is: In horizontally scaled environments, when new application instances are started (e.g., due to scaling or redeployment), they immediately begin consuming events from Redis before custom subscribers are loaded.
Steps to Reproduce
Run script to emit event and leave event in Redis (can be done by setting WORKER_MODE=server)
Start the application.
Observe the logs and behavior of the events being processed before subscribers are loaded.
Expected behavior
Events should not be processed until all subscribers are fully loaded.
Actual behavior
Events may be processed before the relevant subscribers have been initialized, which could cause critical functionality to be missed.
Link to reproduction repo
medusa(v2)
The text was updated successfully, but these errors were encountered:
Package.json file
Node.js version
20.14.0
Database and its version
16.3
Operating system name and version
macOS 14.3.1
Browser name
No response
What happended?
What happened
When there are pending events in Redis waiting to be processed, the following issue occurs during application startup:
event-bus-redis
module is loaded, and thebullWorker
begins processing the events automatically.Processing XXX which has 0 subscribers
and mark these events as completed without proper handling.A common scenario is: In horizontally scaled environments, when new application instances are started (e.g., due to scaling or redeployment), they immediately begin consuming events from Redis before custom subscribers are loaded.
Steps to Reproduce
WORKER_MODE=server
)Expected behavior
Events should not be processed until all subscribers are fully loaded.
Actual behavior
Events may be processed before the relevant subscribers have been initialized, which could cause critical functionality to be missed.
Link to reproduction repo
medusa(v2)
The text was updated successfully, but these errors were encountered: