[PR #1465] [MERGED] fix(backend): manually reconnect cache services after deserialize in message worker #1534

Closed
opened 2026-02-25 21:38:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/1465
Author: @indridieinarsson
Created: 3/7/2025
Status: Merged
Merged: 3/12/2025
Merged by: @mercihabam

Base: masterHead: pr_cache_worker


📝 Commits (1)

  • 53c0aa9 Manually reconnect cache services after deserialize

📊 Changes

2 files changed (+30 additions, -0 deletions)

View changed files

📝 lib/cache.php (+29 -0)
📝 modules/imap/workers/messages_list.php (+1 -0)

📄 Description

🍰 Pullrequest

PR #1452 serializes/unserializes the cache class when handing it to the worker process.
The Redis cache class (and presumably also the memcached class) don't survive this, as the connection to the service is not preserved when serializing. Thus the fetching of messages fails, with a Redis server went away exception message. In some cases, the scripts seems to sort-of work and fetch messages, but it takes longer, since the cache is probably not used.

This PR tries to fix that by adding a public manual `reconnect' function to the hm_cache class, which reconnects the redis or memcached backends.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/1465 **Author:** [@indridieinarsson](https://github.com/indridieinarsson) **Created:** 3/7/2025 **Status:** ✅ Merged **Merged:** 3/12/2025 **Merged by:** [@mercihabam](https://github.com/mercihabam) **Base:** `master` ← **Head:** `pr_cache_worker` --- ### 📝 Commits (1) - [`53c0aa9`](https://github.com/cypht-org/cypht/commit/53c0aa9767359cf0f6dbcbc42e8ced788203674d) Manually reconnect cache services after deserialize ### 📊 Changes **2 files changed** (+30 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `lib/cache.php` (+29 -0) 📝 `modules/imap/workers/messages_list.php` (+1 -0) </details> ### 📄 Description ## 🍰 Pullrequest PR #1452 serializes/unserializes the cache class when handing it to the worker process. The Redis cache class (and presumably also the memcached class) don't survive this, as the connection to the service is not preserved when serializing. Thus the fetching of messages fails, with a `Redis server went away` exception message. In some cases, the scripts seems to sort-of work and fetch messages, but it takes longer, since the cache is probably not used. This PR tries to fix that by adding a public manual `reconnect' function to the hm_cache class, which reconnects the redis or memcached backends. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:38:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1534
No description provided.