Task #3774 (closed)
Bug: uuid.uuid4() causes OmeroPy client creation to fail on Mac OSX
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Milestone: | OMERO-Beta4.3 |
Component: | OmeroPy | Version: | n.a. |
Keywords: | n.a. | Cc: | cneves |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | 2011-01-13 (3) |
Description
When starting multiple django processes on Mac OSX, two different PIDs might generate the same client UUID leading to a failed login:
Thu, 06 Jan 2011 16:24:18 blitz_gateway DEBUG Connect attempt, pid=15591, sUuid=b0837a80-0e35-4032-92d3-aaa0cd08a95c, group=None, self.sUuid=None, self._BaseClient__uuid=9d9873d9-bc2e-4fb9-a51f-313b30995234 24:38 Thu, 06 Jan 2011 16:24:21 blitz_gateway DEBUG Connect attempt, pid=15590, sUuid=b0837a80-0e35-4032-92d3-aaa0cd08a95c, group=None, self.sUuid=None, self._BaseClient__uuid=9d9873d9-bc2e-4fb9-a51f-313b30995234
produces something like:
2011-01-06 13:40:48,864 ERROR [ ome.services.blitz.fire.SessionManagerI] (l.Server-5) Error while creating ServiceFactoryI Ice.AlreadyRegisteredException kindOfObject = "servant" id = "session-ffb674a5-6ec1-4d17-8d6c-0afef9559b1c/f2fa1c4b-411e-4a92-88e6-8a3bc2f2b772" at IceInternal.ServantManager.addServant(ServantManager.java:34)
See:
Change History (10)
comment:1 Changed 13 years ago by jmoore
comment:2 Changed 13 years ago by jmoore
I plan to apply this to our use of uuid in omero/clients.py: http://svn.python.org/view/python/branches/release26-maint/Lib/uuid.py?r1=82277&r2=82276&pathrev=82277
comment:3 Changed 13 years ago by cneves
Because I've been having this issue for a long time now, and because updating to 2.6.6 would be dependency hell all over again, I followed the link on the previous comment and downloaded http://svn.python.org/view/*checkout*/python/branches/release26-maint/Lib/uuid.py placing it in lib/python/omero/nuuid.py
I then changed lib/python/omero/clients.py from:
import uuid
to
import omero.nuuid as uuid
and changed nuuid.py from
import sys
to
sys = __import__('sys')
to prevent omero.sys to be imported. All works wonderfully now!
FYI, I'm on OSX 10.6 with default python 2.6.1.
comment:4 Changed 13 years ago by jmoore
- Remaining Time set to 0.25
comment:5 Changed 13 years ago by jmoore
- Status changed from new to accepted
comment:6 Changed 13 years ago by jmoore
- Remaining Time changed from 0.25 to 0
- Resolution set to fixed
- Status changed from accepted to closed
(In [8903/omero]) Added omero_ext.uuid.py for handling Python:#8621 (Fix #3774)
The new idiom for importing uuid is:
import omero_ext.uuid as uuid # see ticket:3774
comment:7 Changed 13 years ago by Carlos Neves <carlos@…>
(In [5b04916524c57f02c8c51876eb9c3be130dd2d98/ome.git]) Added omero_ext.uuid.py for handling Python:#8621 (Fix #3774)
The new idiom for importing uuid is:
import omero_ext.uuid as uuid # see ticket:3774
comment:8 Changed 13 years ago by jmoore <josh@…>
(In [40ddaa8c242e974d97211baad64848ec70f68f21/ome.git] on branch develop) Fixing use of uuid4 in servants.py (See #3774)
comment:9 Changed 13 years ago by jmoore <josh@…>
(In [dbbf3e9b3d7d65c1b924921f1ab40e1734ef4f7a/ome.git] on branch dev_4_2) Fixing use of uuid4 in servants.py (See #3774)
comment:10 Changed 13 years ago by Carlos Neves <carlos@…>
(In [5b04916524c57f02c8c51876eb9c3be130dd2d98/ome.git]on branches 4_1_custom, dev_4_1_custom, josh/4.1-web-backport) Added omero_ext.uuid.py for handling Python:#8621 (Fix #3774)
The new idiom for importing uuid is:
import omero_ext.uuid as uuid # see ticket:3774
Under Python 2.6.6, the workaround is already in place: