Skip to content

Fix ckan-gather CrashLoopBackOff caused by redis-py 8 socket timeout - #1109

Open
amar-gds-ndl wants to merge 1 commit into
mainfrom
fix/ckan-gather-redis-py8-socket-timeout
Open

Fix ckan-gather CrashLoopBackOff caused by redis-py 8 socket timeout#1109
amar-gds-ndl wants to merge 1 commit into
mainfrom
fix/ckan-gather-redis-py8-socket-timeout

Conversation

@amar-gds-ndl

Copy link
Copy Markdown
Contributor

redis-py 8.0 changed the default socket_timeout from None to 5s when using the Redis() constructor directly. ckanext-harvest's get_connection_redis() uses the constructor when ckan.harvest.mq.hostname is set, giving the gather and fetch consumer pods a 5s socket timeout on their Redis connections.

BLPOP blocks waiting for harvest jobs with no jobs in queue it exceeds the 5s socket timeout immediately, crashing the pod with:
redis.exceptions.TimeoutError: Timeout reading from socket

I have now fixed that by removing the mq.hostname/port/redis_db settings from the configmap. Without mq.hostname, ckanext-harvest falls through to Redis.from_url() using ckan.redis.url (already set), which preserves socket_timeout=None and allows BLPOP to block indefinitely as intended.

redis-py 8.0 changed the default socket_timeout from None to 5s when using
the Redis() constructor directly. ckanext-harvest's get_connection_redis()
uses the constructor when ckan.harvest.mq.hostname is set, giving the gather
and fetch consumer pods a 5s socket timeout on their Redis connections.

BLPOP blocks waiting for harvest jobs — with no jobs in queue it exceeds the
5s socket timeout immediately, crashing the pod with:
  redis.exceptions.TimeoutError: Timeout reading from socket

The fix: remove the mq.hostname/port/redis_db settings from the configmap.
Without mq.hostname, ckanext-harvest falls through to Redis.from_url() using
ckan.redis.url (already set), which preserves socket_timeout=None and
allows BLPOP to block indefinitely as intended.
@amar-gds-ndl
amar-gds-ndl requested a review from ashimali July 31, 2026 11:11
@amar-gds-ndl
amar-gds-ndl requested review from a team as code owners July 31, 2026 11:11
Comment thread charts/ckan/templates/ckan/configmap-2.10.yaml

@ashimali ashimali left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@amar-gds-ndl let's hold off a bit on this as there's a bit more digging needed

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.

2 participants