We've been dealing with a problem with our event gateways since we upgraded from ColdFusion 8 Enterprise to ColdFusion 9 Enterprise.
We have an event gateway setup to establish a connection to a third party. They went us updates at least every 10 seconds and sometimes many times a second.
We have a Java class configured as the Event Gateway listener, and it pushes events and data to a CFC function. In that function we actually use a *named* <cflock> to ensure that requests are dealt with in order, and requests will be queued at this point to have exclusive access to the named lock. This lock has a *30 second* timeout.
I've also got lots of debugging in this function, and I've noticed a few things:
So the problem is that, now and again, I will have a lock timeout occur, and it's after 30 seconds. First I log if the request is waiting for the lock. It looks like this:
"Information","Thread-23","06/23/10","15:45:18","APP1","F4B42A5A-F34D -C614-DE01B150E6906F78 (1277304318606) : PRE LOCK"
And then further down the logs, I see this for the same request:
"Error","Thread-23","06/23/10","15:45:48","APP1","F4B42A5A-F34D-C614- DE01B150E6906F78 (1277304348607) : LOCK ERROR: A timeout occurred while attempting to lock lock_ResponseDispatcher."
There's 30 seconds between them. The requests and any event data associated with it is lost at this point. Not good for me.
So I thought I'd see if the queue was being processed fast enough. I'm unsure how events are queued by <cflock>. Is there a hard limit?
Anyway, on this particular run, I saw that:
I can't believe my eyes! It's as if the <cflock> queue is not processed as first in first out (FIFO), but first in last out (FILO)!
Is such a thing possible? Has anyone else every seen this kind of behaviour?
Many thanks in advance to anyone with any thoughts.
If anyone is interested, I've updated this topic having figured out the issue over on Stackoverflow.com: