-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Hi Jakub.
I'm using your ssm libraries to connect to a Memcached CLUSTER in AWS. As my personal development instances, I'm running a REST Spring Boot API locally on my laptop which connects to the AWS Elasticache/Memcached instance in us-east-1 through a VPN tunnel. However the logs show below error once every Minute:
2018-02-15 16:29:38.186 ERROR net.spy.memcached.ConfigurationPoller: Error encountered in the poller. Current cluster configuration: null
java.lang.RuntimeException: Exception waiting for config
at net.spy.memcached.MemcachedClient.getConfig(MemcachedClient.java:1947)
at net.spy.memcached.ConfigurationPoller.run(ConfigurationPoller.java:126)
at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: net.spy.memcached.internal.CheckedOperationTimeoutException: Operation timed out. - failing node: /10.2.1.21:11211
at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:180)
at net.spy.memcached.internal.GetConfigFuture.get(GetConfigFuture.java:52)
at net.spy.memcached.MemcachedClient.getConfig(MemcachedClient.java:1935)
... 9 more
Caused by: net.spy.memcached.internal.CheckedOperationTimeoutException: Operation timed out. - failing node: /10.2.1.21:11211
... 12 more
2018-02-15 16:29:38.187 WARN net.spy.memcached.ConfigurationPoller: Number of consecutive poller errors is 1. Number of minutes since the last successful polling is 0
Below thread shows other folks experiencing the same error since 2013
https://forums.aws.amazon.com/thread.jspa?threadID=121885
I did a little deep dive and found that in ClientMode.Dynamic mode, net.spy.memcached sets up a Scheduled Thread Poller that runs once a Minute which downloads the configuration from AWS Memcached. net.spy.memcached by default assigns this "get configuration" call a timeout of 2.5 Seconds. However for some reason the call for me (and probably the folks in above AWS forum post) takes just under 5 Seconds and therefore constantly times out.
While looking at the MemcacheClientFactoryImpl code, I can see that you instantiate a net.spy.memcached.MemcachedClient class with "only" a list of IP Addresses (new MemcachedClient(addrs)). MemcachedClient subsequently assumes default timeout values since no configuration was provided.
Would it be possible to change your code so that the caller of ssm can provide net.spy.memcached configuration properties, which then get passed on to the MemcachedClient (e.g. by using new MemcachedClient(connectionFactory, addrs) instead of new MemcachedClient(addrs))?
Your opinion is much appreciated.
Regards
Bernie