-
Notifications
You must be signed in to change notification settings - Fork 14
FIREFLY-1727: Handle Redis failure #1754
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
Conversation
- Try to reconnect until Redis is back online - Show error status to client - Show status in ServerStatus page - Refactor LostConnection.jsx component to use JoyUI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
} | ||
throw new ConnectException("Unable to connect to Redis at " + redisHost + ":" + REDIS_PORT); | ||
String status = failSince == null ? "OK" : | ||
"Failed since " + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault()).format(failSince); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not looking it up but I would think
withZone(ZoneId.systemDefault()
would have a default.
src/firefly/js/core/AppDataCntlr.js
Outdated
@@ -210,6 +221,10 @@ export function isAppReady() { | |||
return get(flux.getState(), [APP_DATA_PATH, 'isReady']); | |||
} | |||
|
|||
export function getConnectionStatus() { | |||
return get(flux.getState(), [APP_DATA_PATH, 'connectionStatus']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not
flux.getState()?.[APP_DATA_PATH]?.connectionnStatus
I find get
to not be very readable and unnecessary these days.
const clzName = decor === 'small' ? 'lost-connection--small' : 'lost-connection'; | ||
const msg = 'You are no longer connected to the server. Try reloading the page to reconnect.'; | ||
if (decor !== 'full') return <div className = {clzName} title = {msg} />; | ||
export function LostConnection () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you did this!
Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1727
Test: https://fireflydev.ipac.caltech.edu/firefly-1727-handle-redis-failure/firefly/
It's a bit harder to test. To simulate Redis down, I've deployed this instance with 2 replicas.
Locally:
-Dredis.host=127.0.0.1
to Tomcat'sbin/setenv.sh
to see how it behaves when Redis is down.