Skip to content

fix: Attach Redis error listeners on Bull and BullMQ collectors - #121

Merged
adamlogic merged 1 commit into
mainfrom
adam/jdo-1508-attach-error-listeners-to-adapter-owned-redis-clients-in
Aug 26, 2026
Merged

adamlogic merged 1 commit into
mainfrom
adam/jdo-1508-attach-error-listeners-to-adapter-owned-redis-clients-in

Conversation

@adamlogic

@adamlogic adamlogic commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Bull and BullMQ metrics collectors created ioredis clients with no error listener. When Redis dropped the socket (idle timeout, ElastiCache reset), ioredis logged [ioredis] Unhandled error event even though it reconnects on its own.

This attaches a listener when none exists and logs the error at debug through Judoscale's logger, so reconnect noise is gone by default and real connection failures remain visible with JUDOSCALE_LOG_LEVEL=debug.

Fixes #120
Fixes JDO-1508

Design decisions

An empty handler would stop the spam but hide real connection failures (bad REDIS_URL, auth/TLS errors, Redis down). Debug-level logging keeps production quiet while remaining opt-in. The listener is only added when listenerCount('error') === 0, so a caller-provided client that already handles errors is left alone.

Adapter-owned ioredis clients had no error listener, so reconnects logged Unhandled error event. Log those errors at debug instead of leaving them unhandled.

Co-authored-by: Cursor <cursoragent@cursor.com>

@carlosantoniodasilva carlosantoniodasilva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@adamlogic
adamlogic merged commit 0d682ae into main Aug 26, 2026
45 checks passed
@adamlogic
adamlogic deleted the adam/jdo-1508-attach-error-listeners-to-adapter-owned-redis-clients-in branch August 26, 2026 14:43
@github-actions github-actions Bot mentioned this pull request Aug 26, 2026
adamlogic pushed a commit that referenced this pull request Sep 17, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>judoscale-bull: 2.1.5</summary>

##
[2.1.5](judoscale-bull-v2.1.4...judoscale-bull-v2.1.5)
(2026-09-17)


### Bug Fixes

* Attach Redis error listeners on Bull and BullMQ collectors
([#121](#121))
([0d682ae](0d682ae))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * judoscale-node-core bumped from 2.5.4 to 2.5.5
</details>

<details><summary>judoscale-bullmq: 2.2.5</summary>

##
[2.2.5](judoscale-bullmq-v2.2.4...judoscale-bullmq-v2.2.5)
(2026-09-17)


### Bug Fixes

* Attach Redis error listeners on Bull and BullMQ collectors
([#121](#121))
([0d682ae](0d682ae))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * judoscale-node-core bumped from 2.5.4 to 2.5.5
</details>

<details><summary>judoscale-express: 2.3.5</summary>

##
[2.3.5](judoscale-express-v2.3.4...judoscale-express-v2.3.5)
(2026-09-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * judoscale-node-core bumped from 2.5.4 to 2.5.5
</details>

<details><summary>judoscale-fastify: 2.4.5</summary>

##
[2.4.5](judoscale-fastify-v2.4.4...judoscale-fastify-v2.4.5)
(2026-09-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * judoscale-node-core bumped from 2.5.4 to 2.5.5
</details>

<details><summary>judoscale-nextjs: 2.0.2</summary>

##
[2.0.2](judoscale-nextjs-v2.0.1...judoscale-nextjs-v2.0.2)
(2026-09-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * judoscale-node-core bumped from 2.5.4 to 2.5.5
</details>

<details><summary>judoscale-node-core: 2.5.5</summary>

##
[2.5.5](judoscale-node-core-v2.5.4...judoscale-node-core-v2.5.5)
(2026-09-17)


### Bug Fixes

* Parse x-request-start in seconds, ms, µs, and ns
([#124](#124))
([e53715c](e53715c))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

judoscale-bullmq creates an ioredis client with no 'error' listener

2 participants