Modify ↓
#11000 closed defect (fixed)
Leaking resources by incorrect use of `open_environment`
Reported by: | Jun Omae | Owned by: | Jeff Hammel |
---|---|---|---|
Priority: | normal | Component: | TicketMoverPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
Original issue at trac:#11139.
The following error is caused by incorrect use of open_environment
.
OSError: [Errno 24] Too many open files: '/opt/trac'
open_environment
without use_cache
creates every time a new instance of Environment
. However, TicketMoverPlugin doesn't release nor cache. Therefore, some resources leak.
-
ticketmoverplugin/ticketmover.py
155 155 for project in _projects: 156 156 path = os.path.join(base_path, project) 157 157 try: 158 env = open_environment(path )158 env = open_environment(path, use_cache=True) 159 159 except: 160 160 continue 161 161 perm = PermissionSystem(env) … … 176 176 # open the environment if it is a string 177 177 if isinstance(env, basestring): 178 178 base_path, _project = os.path.split(self.env.path) 179 env = open_environment(os.path.join(base_path, env) )179 env = open_environment(os.path.join(base_path, env), use_cache=True) 180 180 181 181 # get the old ticket 182 182 old_ticket = Ticket(self.env, ticket_id)
Attachments (0)
Change History (4)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [12863]) TicketMoverPlugin: fix #11000: leaking resources caused by open_environment
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Note: See
TracTickets for help on using
tickets.
jun66j5: k0s is no longer active in the Trac community and has given permission for his plugins to be adopted, so feel free to push the patch directly to the repository.