-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LiveQueryServer crashes when configured to run with Redis cacheAdapter #9432
Comments
Thanks for opening this issue! |
I did debug the initialization of the server and saw that ParseLiveQueryServer creates its own cacheController instance:
but that instance connect() is never called. The regular ParseServer does call connect() on its own instance of the cache when initializing the startup promises. This used to work in earlier versions of parse-server, before we switched to redis 4 client as redis 4 requires the async connect() to be explicitly called before using the client, whereas redis 3 automatically called connect() if the client was not connected. One simple fix would be to add initialization parse-server/src/LiveQuery/ParseLiveQueryServer.js Lines 84 to 94 in 91f9aca
I'm just not clear on why we check this.subscriber.isOpen and if this connect() may be called multiple times, or only on startup? |
The crash is coming from: parse-server/src/Adapters/PubSub/RedisPubSub.js Lines 1 to 11 in 5ca0aa3
Connections do not have an error handler. I am not sure if this issue is related: I created a patch to listen to connection errors and the server is no longer crashing. import { logger } from '../../logger';
function createPublisher({ redisURL, redisOptions = {} }): any {
redisOptions.no_ready_check = true;
const client = createClient({ url: redisURL, ...redisOptions });
client.on('error', (err) => {
logger.error('RedisPubSub publisher client error', {
error: err
});
});
return client;
}
function createSubscriber({ redisURL, redisOptions = {} }): any {
redisOptions.no_ready_check = true;
const client = createClient({ url: redisURL, ...redisOptions });
client.on('error', (err) => {
logger.error('RedisPubSub subscriber client error', {
error: err
});
});
return client;
} |
Issue Description
Running ParseLiveQueryServer where a RedisCacheAdapter is also configured causes crash when ParseLiveQueryServer tries to use the cache adapter.
Steps to reproduce
Actual Outcome
Expected Outcome
LiveQueryServer post update to client
Environment
Server
7.4.0-alpha.5
Azure
Client
iOS/Android
Workaround:
disable the redis cache adapter.
The text was updated successfully, but these errors were encountered: