-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Describe the bug
If my client code successfully manages to connect to FeatureHub at startup, then readiness is reported as Ready. I have added both a timer to regular check readiness, and also registered a ReadinessListener. However, if I stop featurehub then the client still always report that the readyness is true.
Which area does this issue belong to?
- SDK
- SDK examples
- Documentation
- Other
To Reproduce
Steps to reproduce the behavior:
- Create a client using EdgeFeatureConfig, add a readiness listener, and also a timer that regularly calls config.readiness. We have trace mapped to a console.verbose for this test, so we can see what messages we get on connection failure.
The readyness listener has a simple log statement to report the readyness, eg..
console.log('Raw listener readyness is now ' + readiness);
The timer also reports readyness, and simply has:
const newReadiness = config.readyness;
console.log('Readyness is now ' + newReadiness);
- Wait for client to report that the featurehub listener is ready, and we therefore see logging of:
LOG Raw listener readyness is now NotReady
LOG listening at ,http://featurehub:8085/features/<key>
VERBOSE received ack,[object Object]
VERBOSE received features,[object Object]
LOG Raw listener readyness is now Ready
LOG Readyness is now Ready
Whereby the VERBOSE log is from the fhLog trace, and the readynesslistener is reporting the NotReady and Ready, and the timer then goes off and sees ready.
- Leave FeatureHub up for a while and we see logs showing the regular stale connection check and readyness reported as Ready
LOG Readyness is now Ready
VERBOSE received bye,[object Object]
VERBOSE refreshing connection in case of staleness,[object Object]
LOG Readyness is now Ready
VERBOSE received ack,[object Object]
LOG Readyness is now Ready
- Stop FeatureHub, and we see from logs that the readyness listener is never called, and readyness is still reported as true by the timer that is regularly going off.
VERBOSE received bye,[object Object]
VERBOSE refreshing connection in case of staleness,[object Object]
LOG Readyness is now Ready
LOG Readyness is now Ready
VERBOSE refreshing connection in case of staleness,[object Object]
LOG Readyness is now Ready
LOG Readiness is now Ready
VERBOSE refreshing connection in case of staleness,[object Object]
It never seems to discover that FeatureHub is down, as FeatureHub can be left down for a long time, and still we see this cycle.
- When FeatureHub is restarted we see the connection ack from the trace and readyness still reported as true by the timer.
VERBOSE received ack,[object Object]
VERBOSE received features,[object Object]
LOG Readyness is now Ready
Expected behavior
When FeatureHub is not running then we expect that the readinesslistener is called with NotReady, and that the readiness flag if called would report true.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions
- FeatureHub version [1.6.0]
- SDK version [1.3.0]
- OS: [Docker image featurehub/party-server, Docker version 23.0.6, Ubuntu 20.04]
- Browser [Chrome]
You can get the version of the FeatureHub container by running docker ps command.
Please include the OS and what version of the OS and Docker you're running.
Additional context
Putting in some extra debug then there is different detailed in the refreshing connection in case of staleness in the case of when featurehub is down.
When it is the standard refresh then the args on the refresh are:
[{"type":"error"}]
but when featurehub is down we see:
[{"type":"error","message":"getaddrinfo EAI_AGAIN featurehub"}]
where featurehub is the name of the dockercontainer that I was running the featurehub party/server in.