Getting IllegalStateException("Shutting down") on EC2

224 views
Skip to first unread message

Malcolm McMahon

unread,
Aug 17, 2012, 7:13:45 AM8/17/12
to memcached-se...@googlegroups.com
I'm just starting to experiment with the session manager on the Amazon cloud using an elasticcache server and Tomcat6.

I'm getting:

WARNING: An error when trying to load/update validity info.
java.lang.IllegalStateException: Shutting down
        at net.spy.memcached.MemcachedConnection.checkState(MemcachedConnecjava:821)
        at net.spy.memcached.MemcachedConnection.enqueueOperation(Memcachedction.java:638)
        at net.spy.memcached.MemcachedClient.asyncGet(MemcachedClient.java:
        at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:997)
        at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1018)

My configuration currently looks like:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="n1:sessions.4q8dq1.0001.euw1.cache.amazonaws.com:11211"
    sticky="true"
    sessionBackupAsync="true"
    sessionBackupTimeout="1000"
    memcachedProtocol="binary"
    lockingMode="auto"
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory"
    />


I've turned the trace level up to FINE on the spy memcached library, and I've tried updating this to the latest version. Looks like the actual session data is being transferred, but this validity info is not, for some reason.


Martin Grotzke

unread,
Aug 17, 2012, 2:52:47 PM8/17/12
to memcached-se...@googlegroups.com

Validity info is used with sticky=false, I assume this is a c'p error.
The exception says that the connection (or the client?) is being shut down, so I wonder why this is happening. Are there any exceptions logged before this one? Is the memcached service available?

Btw, with nonsticky sessions I'd recommend using async=false.

Cheers,
Martin

Malcolm McMahon

unread,
Aug 21, 2012, 6:17:09 AM8/21/12
to memcached-se...@googlegroups.com, martin....@googlemail.com
I seem to be getting the same error whether I've set sticky to true or false. The server seems to have been available during this test, because there are successful data transfers on the trace log before and after this message (no other exceptions are logged. There's certainly no trouble connecting to the cache from the EC2 instance by telnet.

I do get the point about asychronous mode and non-sticky. I want to do some tests to see what the response time overhead is on the non-sticky mode. I'm hoping I can come up with a compromise which unsticks a session when there's a long gap between transactions, thus minimising the impact on response time, while allowing sessions to migrate to new instances when the autoscaler ramps up the instance count.

BTW, I'm off on my holidays, so can't respond again until next Thursday.

Martin Grotzke

unread,
Aug 22, 2012, 2:37:13 AM8/22/12
to memcached-session-manager

How often does this error occur (only sometimes or all the time, in which interval)?

When there's successful data transfer after this exception is anything indicating a reconnect? Otherwise it makes no sense to me, or the message is just misleading.unfortunately I cannot check spymemcached sources as I'm on holiday (too) with my mobile phone only.

Btw, you shouldn't get this error (with validity info) with sticky sessions, as validity info is only used with nonsticky sessions. Either my memory is wrong or there's s.th. wrong on your side ;-)

Cheers,
Martin

Martin Grotzke

unread,
Oct 10, 2012, 3:58:54 PM10/10/12
to memcached-se...@googlegroups.com
Hi,

first of all please don't hijack existing threads, but start your own
ones (as a general rule regarding mailing lists).

On 10/10/2012 02:06 PM, Preeti wrote:
>
>
> I am new to this. I want to know how to use memcached session manager

for this is
https://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration

> for EC2 instances for handling session data and how elasticache can be
> used in this context?

AWS should have documentation regarding this and how to connect to their
memcacheds.

Do you have more concrete questions?

Cheers,
Martin

signature.asc

Billy Bacon

unread,
Oct 10, 2012, 4:17:51 PM10/10/12
to memcached-se...@googlegroups.com
The setup for getting MSM working in an AWS environment is very similar to a local development setup but the key piece that is very different when in an AWS environment and you are attempting to use their Elasticache service is setting up the proper security groups. There are EC2 security groups and there are Elasticache Security Groups. You will need to create an Elasticache security group and add the EC2 security group which your instance running your war file is in. This will allow your application to connect to port 11211 on the elasticache side.

Hope that helps.

- Billy -
Reply all
Reply to author
Forward
0 new messages