I just posted this to the forum thread on this topic:
---------------

Folks,

It seems like this continues to be a problem, so I thought I would share a
couple of ideas on where the underlying problem might be.  While this won't
get
any of you _directly_ closer to solving your problems, it might be of some
help
to Macromedia in narrowing down the problem.

Understand that this is all just theory offered to try and assist an
eventual
solution, so please don't attack me if I'm off base.  Here goes...

1) The client.properties file is performing the same function as an Oracle
Sequence object declared with CACHE = 100.  This is a very efficient model
for
high transaction systems, as the requester simply queries a lightweight
object
pinned in memory that simply gets the next pre-cached value from an array,
increments the index into the array, checks if the new index value is equal
to
the CACHE value (or directly tests the issued value against the value at the
end
of the array), and if so updates the persistent "placeholder" for the
sequence
value, which is in the form of a text file.

2) I assume that the LastID is "forward-looking" to the beginning of the
next
sequence series being cached, rather than "backward-looking" to the start of
the
current sequence series cached, since after a restart the mechanism must
enable
CFMX to pick right up where it left off without having to check anything
other
than this one persistent file.  Anything else would cause overlapping values
to
be issued from the sequence, which would in turn overlap CFMX client IDs and
throw everything off.

3) Since the sequence object pinned in memory must modify internal values
every
time it is called, all access to it would be synchronized through an
exclusive
lock on the object.  If the system must suffer the mechanical bottleneck of
an
exclusive lock with each request, it must do so in the least
resource-intensive
manner possible.  This is the main reason why this whole
client.properties/sequence object mechanism exists in the first place: to
prevent the performance bottleneck that would occur if the system had to
exclusively lock and manipulate a file each time an ID request was made.  So
instead, CFMX just locks an existing object in memory that already contains
100
requests' worth of data and one simple index value that must be modified.
Simultaneous requests of the object are queued, but not for very long (in
terms
of nanoseconds).  Except for the request that gets the last value in the
array,
as this triggers the modification of the client.properties file.

4) Because access to the client.properties file is managed by the OS,
OS-level
mutex objects (locks) handle sequential I/O from this file, which is
certainly
slower than a mutex on an object pinned in memory.  If CFMX has a problem
with
its "acquire lock/read file/write file/release lock" procedure on the
client.properties file, then that would cause one of two things: either an
empty
client.properties file, or an unchanged client.properties file.

5) This is where their internal exception handling model comes into play,
because what do you do if the modified file cannot be written to disk?  What
if
CFMX couldn't acquire an exclusive lock in the time Macromedia's programmers
allotted?  Everything pivots on the two critical steps of acquiring an
exclusive
file lock and writing a properly-formatted file while the lock is in place.
Keep this in mind as we discuss the subject further.

6) There is an anomaly in the system that causes the ID to return a value
that
is not one but _two_ more than the previous issued value.  This makes me
focus
on the exact mechanism used to trigger the modification of
client.properties.
Is the test a match of the index value to the size of the array, or is it a
match of the value retrieved to the last value in the array?  If the former,
this anomaly will cause some of the next batch of sequence values issued by
the
object to overlap those it had already issued from the previous batch.  If
the
latter, we need to ask another question: is the test an equality test, or a
"greater than or equal to" test.  If a strict equality test, this anomaly
might
cause the test to sometimes fail.  What happens to the next ID request after
this "end of array" test fails?  Is the result a NULL value, perhaps?

7) So now we're back to updating client.properties.  With what value?  If I
were
the engineer, I wouldn't take the time to read the file, parse the contents,
extract the string containing the LastID value, convert it to an integer,
and
increment it.  I would simply take the value I have in hand (issued by the
object), increment that by 100, construct the new string contents of the
client.properties file, and overwrite the file.  So, if this issued value is
NULL, and you try to concatenate that NULL value with any other value, the
result will be NULL, right?  So the file that is written to disk (if not
checked
for empty content) is empty.

8) Or what if an error _is_ thrown trying to update the client.properties
file?
If you were the engineer, how would you handle such a problem so central to
the
entire functionality of the system?  You can handle the error as an
exception,
then route that exception to a retry of the update, but you'd have to quit
retrying after a certain amount of time or retries, otherwise you could put
the
system into an endless loop.  Perhaps retrying with a longer allowable time
limit to acquire the exclusive lock on client.properties?

Anyway, all this is just theory, but I figured that _any_ input from
anywhere at
this point might help somewhat.  Maybe this discussion sparks an idea in the
mind of a CFMX-based ISP who observed some seemingly unrelated behavior that
might have bearing on this issue.  Anyway, I would investigate further by
asking
all of you to ask yourselves these questions:

* Do you ISPs see this problem equally on shared servers and dedicated
servers?

* Do any of you see this problem happening on some of your servers but not
on
others?  If so, what are the differences between them?

* Does the frequency of this problem parallel the load on the system having
the
problem?

* Can you reproduce this problem by turning off cookies, closing the
browser,
re-launching the browser, and going back to the site?  If so, does this also
trigger problems afterward for other clients who have not turned off their
cookies?

* Does the problem _always_ disappear after deleting cookies, closing the
browser, cycling the CFMX service, re-launching the browser, and making a
new
request?

* Can you reproduce this problem by modifying the CFID value in the URL?

* Have you observed any pattern or semi-pattern for the problem appearing or
disappearing?

Guys, I hope this discussion can somehow lead to a solution.  If I'm in
error on
any of this then please understand that I'm only theorizing as to how it
*might*
work behind the scenes and how that might lead to the problem itself -- and
therefore help Macromedia find a solution.

Respectfully,

Adam Phillip Churvis
Advanced Intensive ColdFusion MX Training
http://www.ColdFusionTraining.com
E-mail:  [EMAIL PROTECTED]
Phone:   770-446-8866
Team Macromedia Volunteer for ColdFusion
http://www.macromedia.com/support/forums/team_macromedia/

----- Original Message -----
From: "Mark Leder" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, October 28, 2002 10:06 AM
Subject: What in the world is this?


> In the application.cfm, right after the CFAPPLICATION tag (running on
> Win CFMX) I get the following NULL - however the line in question is a
> comment tag???:
> ==========================
> null
>
> The error occurred in C:\Inetpub\website\admin\Application.cfm: line 24
>
> 22 : <!--- This page creates global variables for use throughout the
> site --->
> 23 :
> 24 : <!--- Toggles the security check 0=off 1=on --->
> 25 : <CFSET REQUEST.securitycheck = "0">
> 26 :
> ==========================
>
> Thanks,
> Mark
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to