upload-pack: Delay reserving database connection until executing
We don't want to check out a connection from the connection pool
until we know we have been granted a thread from the thread pool
to execute on. If we grab the connection when the Upload object is
created, and we have to wait 5 seconds to get a thread for runImpl()
to execute on, we'll simply be tieing up that connection for the
entire duration of the wait. So use a Provider instead so we can
defer obtaining the connection.
Change-Id: I9ac360981fb1ad3e09e77ad579e9203686b14494
Signed-off-by: Shawn O. Pearce <sop@google.com>
Reviewed-by: Nico Sallembien <nsallembien@google.com>
1 file changed