<div dir="ltr">We&#39;ve seen this too. We use sticky sessions (using a cookie) as a workaround, like David suggested.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 29, 2013 at 8:51 AM, Malthe Borch <span dir="ltr">&lt;<a href="mailto:mborch@gmail.com" target="_blank">mborch@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It sounds like a race condition. It might be that you&#39;ve got a very<br>
low network latency between the web server and web browser such that<br>
there&#39;s hardly any time for the invalidation messages to propagate.<br>
<br>
But just to be certain it&#39;s not an issue with system time, check if<br>
your entire cluster is time-synchronized.<br>
<br>
\malthe<br>
<div><div class="h5"><br>
On 29 May 2013 08:42, David Glick (Plone) &lt;<a href="mailto:david.glick@plone.org">david.glick@plone.org</a>&gt; wrote:<br>
&gt; On 5/28/13 7:53 PM, Dylan Jay wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; My colleague is having the issue outlined below. I thought this list might<br>
&gt; be better to give an insight as to what is going on?<br>
&gt;<br>
&gt; Begin forwarded message:<br>
&gt;<br>
&gt; From: Adam Terrey &lt;<a href="mailto:adam@pretaweb.com">adam@pretaweb.com</a>&gt;<br>
&gt; Subject: Fwd: Zope/Plone/Zeo Concurrency Issue<br>
&gt; Date: 28 May 2013 5:23:33 PM AEST<br>
&gt; To: Dylan Jay &lt;<a href="mailto:djay@pretaweb.com">djay@pretaweb.com</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; -------- Original Message --------<br>
&gt; Subject: Zope/Plone/Zeo Concurrency Issue<br>
&gt; Date: Tue, 28 May 2013 16:04:21 +1000<br>
&gt; From: Adam Terrey &lt;<a href="mailto:adam@pretaweb.com">adam@pretaweb.com</a>&gt;<br>
&gt; To: <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; Can someone offer some insight into what might be going on here and perhaps<br>
&gt; how I can debug the following issue?<br>
&gt;<br>
&gt; In Plone there is a request patten used to create content which looks<br>
&gt; like...<br>
&gt;<br>
&gt; (A) GET request to /MySite/createObject?type_name=Document<br>
&gt; Responds with a redirect to a tempory document at a location such as<br>
&gt; /MySite/portal_factory/Document/document.2013-05-28.1878040976/edit<br>
&gt; (B) GET /MySite/portal_factory/Document/document.2013-05-28.1878040976/edit<br>
&gt; Responds with from to set fields in the Document<br>
&gt; (C) POST request to<br>
&gt; /MySite/portal_factory/Document/document.2013-05-28.1878040976/atct_edit<br>
&gt; Responds with a redirect to the final location of the document such as<br>
&gt; /Mysite/my-page<br>
&gt; (D) GET /Mysite/my-page<br>
&gt; Responds with the newly created page<br>
&gt;<br>
&gt; In one of our production systems we are running multiple Zope/Plone<br>
&gt; instances connecting to a Zeo server. And the above patten works about 95%<br>
&gt; of the time. However, sometimes request (D) will respond with 404 Page Not<br>
&gt; Found. My assumptions is that request (C) and (D) are going to different<br>
&gt; instances and somehow the instance handling request (D) does not yet see the<br>
&gt; transaction with completed the page creation.<br>
&gt;<br>
&gt; I&#39;ve checked that the transaction commit happens before response headers are<br>
&gt; emitted for request (C) - suspecting the case that the browser handles the<br>
&gt; redirect before the transaction is completed - but this is clearly not the<br>
&gt; case from what i can see. The transaction is well committed before response<br>
&gt; headers are returned.<br>
&gt;<br>
&gt; Versions are as follows:<br>
&gt;<br>
&gt; Plone 4.1.3 (4112)<br>
&gt; CMF 2.2.4<br>
&gt; Zope 2.13.10<br>
&gt; Python 2.7.2+ (default, Oct 4 2011, 20:06:09) [GCC 4.6.1]<br>
&gt;<br>
&gt; I have been using the following script to recreate the issue. I seem to be<br>
&gt; able to produce the error quicker if I put server2 under apache-bench load,<br>
&gt; and I have been able to recreate the issue on a local copy of our production<br>
&gt; system but it is a far more rare case.<br>
&gt;<br>
&gt; auth = (&#39;admin&#39;, &#39;admin&#39;)<br>
&gt; server1 = &#39;<a href="http://localhost:46101" target="_blank">http://localhost:46101</a>&#39;<br>
&gt; server2 = &#39;<a href="http://localhost:46102" target="_blank">http://localhost:46102</a>&#39;<br>
&gt; site = &#39;/Plone&#39;<br>
&gt;<br>
&gt; import requests<br>
&gt;<br>
&gt; ses = requests.Session()<br>
&gt; ses.auth=auth<br>
&gt;<br>
&gt; for i in range(10):<br>
&gt;<br>
&gt;     # Create tempory Object<br>
&gt;     create_url = server1 + site + &#39;/createObject?type_name=Document&#39;<br>
&gt;     print &quot;GET&quot;, create_url<br>
&gt;     res = ses.get (create_url)<br>
&gt;     tempory_obj = res.url.rsplit(&quot;/&quot;, 1)[0]<br>
&gt;     print &quot;tempory object:&quot;, tempory_obj<br>
&gt;<br>
&gt;<br>
&gt;     # Submit data to create object (response will<br>
&gt;     # be the redirect ot the ojbect&#39;s location)<br>
&gt;<br>
&gt;     data = {<br>
&gt;                  &#39;id&#39;: &#39;&#39;,<br>
&gt;                  &#39;title&#39;: &#39;page&#39; + str(i)   ,<br>
&gt;                  &#39;form.button.save&#39;: &#39;Save&#39;,<br>
&gt;                  &#39;form.submitted&#39;: &#39;1&#39;,<br>
&gt;                  &quot;description&quot;: &quot;some secriot&quot;,<br>
&gt;                  &quot;text&quot;: &quot;some text&quot;<br>
&gt;                  }<br>
&gt;<br>
&gt;     post_url = tempory_obj + &quot;/atct_edit&quot;<br>
&gt;     print &quot;POST&quot;, post_url<br>
&gt;     res = ses.post(post_url, data=data, allow_redirects=False)<br>
&gt;<br>
&gt;     redirect_location = &quot;/&quot; + res.headers[&#39;location&#39;][7:].split(&#39;/&#39;,1)[1]<br>
&gt;     print &#39;redirect_location&#39;, redirect_location<br>
&gt;<br>
&gt;<br>
&gt;     # Request object from the redirect from server2<br>
&gt;     redirect_url = server2 + redirect_location<br>
&gt;     print &quot;GET&quot;, redirect_url<br>
&gt;     res = ses.get(redirect_url)<br>
&gt;<br>
&gt;     if res.status_code != 200:<br>
&gt;         last404 = res<br>
&gt;         print res;<br>
&gt;         break;<br>
&gt;<br>
&gt;     print &quot;---&quot;<br>
&gt;<br>
&gt;<br>
&gt; Any help would be appreciated.<br>
&gt;<br>
&gt;<br>
&gt; I&#39;ve encountered a problem like this once or twice and had some trouble<br>
&gt; reproducing it consistently, but assume it&#39;s due to ZEO invalidation<br>
&gt; messages not making it to the other instance before it serves request D.<br>
&gt;<br>
&gt; You can work around the issue using sticky sessions in your load balancer.<br>
&gt; If you don&#39;t want users to be stuck to a particular backend indefinitely you<br>
&gt; can set a cookie with a brief expiration in an ObjectAddedEvent handler and<br>
&gt; use it as the basis for the stickiness.<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; For more information about ZODB, see <a href="http://zodb.org/" target="_blank">http://zodb.org/</a><br>
&gt;<br>
&gt; ZODB-Dev mailing list  -  <a href="mailto:ZODB-Dev@zope.org">ZODB-Dev@zope.org</a><br>
&gt; <a href="https://mail.zope.org/mailman/listinfo/zodb-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zodb-dev</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Au revoir, et tous mes voeux pour un avenir plein de succès et de bonheur ––<br>
<br>
Malthe Borch<br>
<a href="mailto:mborch@gmail.com">mborch@gmail.com</a><br>
_______________________________________________<br>
For more information about ZODB, see <a href="http://zodb.org/" target="_blank">http://zodb.org/</a><br>
<br>
ZODB-Dev mailing list  -  <a href="mailto:ZODB-Dev@zope.org">ZODB-Dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/zodb-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zodb-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Roel Bruggink<br><a href="http://www.fourdigits.nl/mensen/roel-bruggink" target="_blank">http://www.fourdigits.nl/mensen/roel-bruggink</a><br><br><font face="arial, sans-serif"><span style="border-collapse:collapse">Four Digits BV</span></font><br>
<a href="http://www.fourdigits.nl/" target="_blank">http://www.fourdigits.nl</a><span> </span><span>tel: <a value="+31264422700" style="color:rgb(17,85,204)">+31(0)26 4422700</a></span>
</div>