Closed joshmoore closed 5 years ago
https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/60/testReport/OmeroPy.test.integration.tablestest.test_service/TestTables/testCallContext/ needs updating now that a stateful service is present for each table:
def setSecurityContext(self, obj, _ctx=None):
> return _M_omero.api.ServiceFactory._op_setSecurityContext.invoke(self, ((obj, ), _ctx))
E SecurityViolation: exception ::omero::SecurityViolation
E {
E serverStackTrace = ome.conditions.SecurityViolation: SecurityContext change cancelled:
E fde941e0-a25a-45b6-9060-e0f594a90a83 has active stateful services:
E
E Table-1e2bf983-0d99-440f-b5c4-8277ae98193d
E
E at ome.services.sessions.events.ChangeSecurityContextEvent.throwIfCancelled(ChangeSecurityContextEvent.java:59)
E at ome.services.sessions.SessionManagerImpl.setSecurityContext(SessionManagerImpl.java:1240)
E at ome.services.blitz.impl.ServiceFactoryI.setSecurityContext(ServiceFactoryI.java:236)
E at omero.api._ServiceFactoryTie.setSecurityContext(_ServiceFactoryTie.java:269)
E at omero.api._ServiceFactoryDisp.___setSecurityContext(_ServiceFactoryDisp.java:472)
E at omero.api._ServiceFactoryDisp.__dispatch(_ServiceFactoryDisp.java:1375)
E at IceInternal.Incoming.invoke(Incoming.java:221)
E at Ice.ConnectionI.invokeAll(ConnectionI.java:2536)
E at Ice.ConnectionI.dispatch(ConnectionI.java:1145)
E at Ice.ConnectionI.message(ConnectionI.java:1056)
E at IceInternal.ThreadPool.run(ThreadPool.java:395)
E at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
E at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:832)
E at java.lang.Thread.run(Thread.java:748)
E
E serverExceptionClass = ome.conditions.SecurityViolation
E message = SecurityContext change cancelled:
E fde941e0-a25a-45b6-9060-e0f594a90a83 has active stateful services:
E
E Table-1e2bf983-0d99-440f-b5c4-8277ae98193d
Merging for release as 5.5.3. This will be deployed on pub-omero for a bit of extended use.
TablePrx instances from the Tables-0 process are not registered in a session as a stateful service. Clients can't know or discover that they are open. The TableCloser implements StatefulServiceInterface to allow clients to call close().
Tested via this script:
which prints:
Opening now to get it into regular testing. ~Additional integration tests will be needed in openmicroscopy/openmicroscopy.~ This PR prevents calling
getOriginalFile()
afterclose()
has been called, which has clearly been proven throughout the code base.