Copy link to clipboard
Copied
I need to time out my CFLDAP queries as we are having trouble with the logins hanging. We have so many people logging into our system that very quickly all the active threads are used up, everything else gets queued, and in a matter of seconds we're ready to crash.
I read a fair bit about the CFLDAP tag online. But I have two questions:
1. I saw a number of comments about the timeout of external calls, that CF can't really kill an external call, but has to wait for it to return before it can cut the connection. Is this true with the CFLDAP Tag? If so, the timeout setting is pretty well useless to me.
2. I saw a number of questions on the setting itself, that despite the fact that the documentation says it's in seconds, it's actually in milliseconds. I was just looking at some docs for CF 9, and it now says milliseconds. We're on CF8 - is it seconds or milliseconds?
Our LDAP server and network are fast enough that they should come back fairly quickly, so I'm thinking about setting the threshold fairly low, and we'll see how it goes. Some folks might not be able to log in, but it would save some grief for the majority.
Copy link to clipboard
Copied
1. I saw a number of comments about the timeout of external calls, that CF can't really kill an external call, but has to wait for it to return before it can cut the connection. Is this true with the CFLDAP Tag? If so, the timeout setting is pretty well useless to me.
Well CF can't kill the external call if the external system won't allow for a "kill it" message to be sent.
This is not the same as CF stopping waiting for a response after a certain timeout period, which is what the timeout setting is all about.
2. I saw a number of questions on the setting itself, that despite the fact that the documentation says it's in seconds, it's actually in milliseconds. I was just looking at some docs for CF 9, and it now says milliseconds. We're on CF8 - is it seconds or milliseconds?
Both the CF8 & CF9 docs I'm looking at say milliseconds:
CF8:
http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_j-l_03.html#3988374
CF9:
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f97.html
Where did you hear it was in seconds?
--
Adam
Copy link to clipboard
Copied
Interesting. Anything V6 or older Docs, shows seconds. Apparently I have an old help file on my desk top, I need to replace.
I have had issues in the past with database calls not timing out. I could not get them to time out. I can get the template as a whole to timeout if the DB request is answering, but a hung query just won't let go. We would have database blocks, and everything else would pile up and wait.
I'll try changing the timeout setting on my CFLDAP tag, and see if that at least helps me with the problems I've been seeing.
Copy link to clipboard
Copied
Interesting. Anything V6 or older Docs, shows seconds. Apparently I have an old help file on my desk top, I need to replace.
Hmmm... well your reference should match the same version you're developing in, anyhow!
I would would split my money between the CFMX6x docs being wrong, or the behaviour having been changed back in CFMX7 (which was released five years ago, btw!). Although Macromedia/Adobe don't like breaking backwards compat, so I am hesitant about that. Also... they're pretty good at keeping the HISTORY second of each tag's entry accurate, and it'd be listed there if it'd changed.
Still: it should be easy to test.
I hasten to add, I don't know one way or the other. I was just commenting on your own comment about the docs.
One way to force CF to "timeout" any process is to call it in a separate thread, with that thread's last instruction being to set a variable that the calling thread can see. In the calling thread JOIN the second thread back in, specifying a timeout. After the join, check to see if the variable has been set, which implies the other thread finished fine. If the variable is not set, the other thread didn't finish, so deal with that accordingly (kill the thread, back-out the process, raise an exception, etc).
--
Adam