[ome-devel] Python SessionTimeoutException

Josh Moore josh at glencoesoftware.com
Thu Mar 10 07:47:46 GMT 2016


On Wed, Mar 9, 2016 at 12:12 PM, Niko Ehrenfeuchter
<nikolaus.ehrenfeuchter at unibas.ch> wrote:
> Hi Josh,

Hi Niko,


> apologies for the delay, been busy with running a workshop on the last two
> days...

No worries.


> On 07.03.2016 12:05, Josh Moore wrote:
...
>>>> Am I doing something wrong? Please note that this is on 5.1.2!
>>
>>
>> I'll see if I can find anything that's been fixed since then, though
>> it might also be worth upgrading (hint, hint). That being said, how
>
>
> I know, really. We've been delayed for various reasons (new server hardware,
> new network components, new CentOS base deployment, Mondays, full moon,
> dwarves and so on), but it definitely is a top priority right now. Yet, I
> have to support our users with our current set-up ;-)

Blast those full moon dwarves...


>> 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.


> 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.


> Cheers
> Niko

Cheers,
~Josh.


More information about the ome-devel mailing list