[ome-users] BlitzGateway: keep connection alive to write large ROIs

William Moore (Staff) W.Moore at dundee.ac.uk
Mon May 1 13:15:46 BST 2017


Hi Paul,

I used the tiny script below to test what you’re seeing….

First I set the session timeout to 10 seconds:

$ bin/omero config set omero.sessions.timeout 10000

Then I ran the script to see if the  conn.c.enableKeepAlive(5)  would allow me to
perform other calls that lasted longer than 10 seconds, such as time.sleep(15).

This seems to work.
I think you may have your keepAlive interval longer than the session timeout?
This is confusing since the session timeout is in milliseconds but the
keepAlive interval is in seconds, so it’s easy to accidentally set the keepAlive
to be too long (longer than the session timeout).

In the example below, if I use conn.c.enableKeepAlive(50)
then I see the same as you "warning: Proxy keep alive failed.”
because this is longer than 10 seconds (omero.sessions.timeout 10000)

Hopefully that was the problem?
If not, you’ll need to show us more of your code, or a sample script that
replicates the problem, and say what your session timeout is.

 Regards,

   Will.



from omero.gateway import BlitzGateway

conn = BlitzGateway(“username", “password", host="localhost", port=4064)
conn.connect()

# Ping interval in SECONDS - KeepAlive Interval must be shorter than
# omero config set omero.sessions.timeout 10000
# which is in MILLISECONDS
conn.c.enableKeepAlive(5)

print "start..."
time.sleep(15)

print conn.c.sf.getAdminService().getEventContext().userName

conn.close()



On 27 Apr 2017, at 14:04, Paul Korir <pkorir at ebi.ac.uk<mailto:pkorir at ebi.ac.uk>> wrote:


By the way, the keepalive gave the following:

-! 04/27/17 12:07:15.006 warning: Proxy keep alive failed.

On 26/04/2017 11:16, William Moore (Staff) wrote:
Hi Paul,

 You can enable the keepAlive on the client object with
conn.c.enableKeepAlive(300)
See 5.2 docs: https://downloads.openmicroscopy.org/omero/5.2.0/api/omero/client.html#enableKeepAlive-int-

Also you can set this in the etc/omero.properties file.
See discussion at https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=495

Hope that helps,

  Will.


--
Paul K. Korir, PhD
Scientific Programmer
EMBL-EBI
01223494422


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20170501/72d65dc2/attachment.html>


More information about the ome-users mailing list