[ome-devel] Python SessionTimeoutException

Niko Ehrenfeuchter nikolaus.ehrenfeuchter at unibas.ch
Fri Mar 11 16:23:10 GMT 2016


Hi Josh,

On 10.03.2016 08:47, Josh Moore wrote:
>>> are the sessions for the script runs being created? In the script
>>> itself? Or externally and passed via -k?
>>
>>
>> The sessions are established by the script during runtime. The relevant code
>> is basically this:
>>
>>> from omero.gateway import BlitzGateway
>>> su_conn = BlitzGateway(SU_USER, SU_PASS, host=HOST, port=PORT)
>>> conn = su_conn.suConn(username)
>>> do_the_real_work()
>>> conn._closeSession()
>
> Think that's the reason then:
>
> https://github.com/openmicroscopy/openmicroscopy/blob/v5.1.2/components/tools/OmeroPy/src/omero/gateway/__init__.py#L1597
>
> def suConn(self, username, group=None, ttl=60000):
>      """
>      If current user isAdmin, return new connection owned by 'username'
>      ...
>      :param ttl: Timeout for new session
>
> You should be able to pass your own value for `ttl` then.

Perfect, this seems to be fixing my issue. Thanks for spotting!


>> Am I doing something wrong here? Thinking about the su_conn session not
>> being closed I went checking if there are tons of dangling root-sessions,
>> but I can't find any so I'm guessing this is not the problem.
>
> As long as you're eventually closing conn and su_conn, all should be fine.

I am doing so. Should be fine.


Thanks again & enjoy the weekend!

~Niko


More information about the ome-devel mailing list