<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Paul,
<div class=""><br class="">
</div>
<div class="">I used the tiny script below to test what you’re seeing….</div>
<div class=""><br class="">
</div>
<div class="">First I set the session timeout to 10 seconds:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">
$ bin/omero config set omero.sessions.timeout 10000</div>
</div>
<div class=""><br class="">
</div>
<div class="">Then I ran the script to see if the  conn.c.enableKeepAlive(5)  would allow me to </div>
<div class="">perform other calls that lasted longer than 10 seconds, such as time.sleep(15).</div>
<div class=""><br class="">
</div>
<div class="">This seems to work.</div>
<div class="">I think you may have your keepAlive interval longer than the session timeout?</div>
<div class="">This is confusing since the session timeout is in milliseconds but the</div>
<div class="">keepAlive interval is in seconds, so it’s easy to accidentally set the keepAlive</div>
<div class="">to be too long (longer than the session timeout).</div>
<div class=""><br class="">
</div>
<div class="">In the example below, if I use conn.c.enableKeepAlive(50)</div>
<div class="">then I see the same as you "warning: Proxy keep alive failed.”</div>
<div class="">because this is longer than 10 seconds (<span style="color: rgb(76, 47, 45); font-family: Courier; background-color: rgb(223, 219, 196);" class="">omero.sessions.timeout 10000)</span></div>
<div class=""><br class="">
</div>
<div class="">Hopefully that was the problem?</div>
<div class="">If not, you’ll need to show us more of your code, or a sample script that</div>
<div class="">replicates the problem, and say what your session timeout is.</div>
<div class=""><br class="">
</div>
<div class=""> Regards,</div>
<div class=""><br class="">
</div>
<div class="">   Will.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">from omero.gateway import BlitzGateway</div>
<div class=""><br class="">
</div>
<div class="">conn = BlitzGateway(“username", “password", host="localhost", port=4064)</div>
<div class="">conn.connect()</div>
<div class=""><br class="">
</div>
<div class=""># Ping interval in SECONDS - KeepAlive Interval must be shorter than </div>
<div class=""># omero config set omero.sessions.timeout 10000</div>
<div class=""># which is in MILLISECONDS</div>
<div class="">conn.c.enableKeepAlive(5)</div>
<div class=""><br class="">
</div>
<div class="">print "start..."</div>
<div class="">time.sleep(15)</div>
<div class=""><br class="">
</div>
<div class="">print conn.c.sf.getAdminService().getEventContext().userName</div>
<div class=""><br class="">
</div>
<div class="">conn.close()</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 27 Apr 2017, at 14:04, Paul Korir <<a href="mailto:pkorir@ebi.ac.uk" class="">pkorir@ebi.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
<p class="">By the way, the keepalive gave the following:</p>
<p class="">-! 04/27/17 12:07:15.006 warning: Proxy keep alive failed.</p>
<br class="">
<div class="moz-cite-prefix">On 26/04/2017 11:16, William Moore (Staff) wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:061C29A5-B2E3-4919-9692-D9A744CAC7EB@dundee.ac.uk" class="">
Hi Paul,
<div class=""><br class="">
</div>
<div class="">
<div class=""> You can enable the keepAlive on the client object with</div>
<div class="">conn.c.enableKeepAlive(300)</div>
<div class="">See 5.2 docs: <a href="https://downloads.openmicroscopy.org/omero/5.2.0/api/omero/client.html#enableKeepAlive-int-" class="" moz-do-not-send="true">
https://downloads.openmicroscopy.org/omero/5.2.0/api/omero/client.html#enableKeepAlive-int-</a> </div>
<div class=""><br class="">
</div>
<div class="">Also you can set this in the etc/omero.properties file.</div>
<div class="">See discussion at <a href="https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=495" class="" moz-do-not-send="true">
https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=495</a>  </div>
</div>
<div class=""><br class="">
</div>
<div class="">Hope that helps,</div>
<div class=""><br class="">
</div>
<div class="">  Will.</div>
</blockquote>
<br class="">
<pre class="moz-signature" cols="72">-- 
Paul K. Korir, PhD
Scientific Programmer
EMBL-EBI
01223494422</pre>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>