Re: [snapshot/master] Fix certain db handle leak
On Tue, 20 Apr 2010, Peter Palfrader wrote:
> index 8d20620..a62b8a0 100644
> --- a/web/app/snapshot/controllers/archive.py
> +++ b/web/app/snapshot/controllers/archive.py
> @@ -244,7 +244,10 @@ class ArchiveController(BaseController):
>
> def file(self, hash):
> if re.match('[0-9a-f]{40}$', hash): # match matches only at start of string
> - return self._regular_file(hash)
> + try:
> + return self._regular_file(hash)
> + finally:
> + self._db_close()
> else:
> abort(404, 'Invalid hash format.')
I think this bug, together with somebody fetching lots of files from
/file/<hash> caused the 500 server error problem this afternoon, and the
accompanying recent flood of error mails.
--
| .''`. ** Debian GNU/Linux **
Peter Palfrader | : :' : The universal
http://www.palfrader.org/ | `. `' Operating System
| `- http://www.debian.org/
Reply to: