killme2008 / killme2008/xmemcached
addServer() not blocking and causes uncaught exception with Healing enabled
- Dominant language
- Java
- Stars
- 764
- Forks
- 271
- PR merge metrics
- No merged PRs in 30d
Description
addServer() is non-blocking. According to the documentation it is supposed to block until a successful or failed connection. The documentation also says that a IOException should be thrown if the client cannot connect. Instead addServer() seems to try to connect on a separate thread and allow the calling thread to immediately continue. In the case of no memcached server being available and healing set to true. addServer() not thrown an immediate IOException and instead returns normally a memcachedClient instance. A background thread keeps trying to connect until retries are exhausted and then an IOException is thrown in that separate thread cause crashing my app unexpectedly.
I had to write some logic to handle this unexpected behavior using the stateListeners.
I think either the logic should be fixed to match the docs or the docs should be edited to match the behavior and possibly some examples added on how to handle memcached server not available when addServer() is called.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the addServer() entry point and the documentation describing its blocking behavior and IOException handling. Reproduce the case with healing enabled and no memcached server available, then determine whether the implementation or documentation should be corrected; done when connection failure no longer causes an unexpected uncaught exception or the documented behavior and handling guidance match reality.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100