Bug #416 (closed)
Opened 18 years ago
Closed 16 years ago
Race condition on `ServiceFactory.setUmask()`
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Cc: | |
Sprint: | n.a. | ||
Total Remaining Time: | n.a. |
Description
To set a umask for a particular call, one calls ServiceFactory.setUmask(Permissions). However, between calling SF.setUmask() and service.someMethod() another thread might reset the umask.
- Document the need for synchronization, or
- Change the method to ServiceFactory.setUmask( ServiceInterface, Permissions ) and handle the synchronization internally.
Change History (4)
comment:1 Changed 18 years ago by jmoore
- Milestone changed from Unscheduled to 3.0-M4
comment:2 Changed 18 years ago by jmoore
Should also provide a ServiceFactory.getUmask() method so that something of the form:
Permissions oldPermissions = sf.getUmask(); try { sf.setUmask(newPermissions); // do something } finally { if (sf!=null) sf.setUmask(oldPermissions); }
can be done.
comment:3 Changed 17 years ago by jmoore
- Milestone changed from 3.0-Beta2 to 3.0-Beta3
This needs the new session management code: proposals/SessionsAndMessages
comment:4 Changed 16 years ago by jmoore
- Resolution set to fixed
- Status changed from new to closed
Merged into #864.
Another option would be to use a PrincipalHolder rather than a Principal so that the threads don't compete.
It may also be necessary that new ServiceFactory() NOT return a static instance for similar reasons.