]> dgit.raspbian.org Git - git-annex.git/commitdiff
add debugging of opening and closing connections to proxies
authorJoey Hess <joeyh@joeyh.name>
Mon, 29 Jul 2024 13:48:06 +0000 (09:48 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 29 Jul 2024 13:52:26 +0000 (09:52 -0400)
P2P/Http/State.hs
doc/todo/git-annex_proxies.mdwn

index 36f6d6ce690c227a3e3b6273a99dbb0004bb7e40..0617064947b90ac0a7f08867b3c112f5056947d3 100644 (file)
@@ -539,13 +539,20 @@ instance Show ProxyConnection where
 
 openedProxyConnection
        :: UUID
+       -> String
        -> Proxy.ProxySelector
        -> Annex ()
        -> Proxy.ConcurrencyConfig
-       -> IO ProxyConnection
-openedProxyConnection u selector closer concurrency = do
-       now <- getPOSIXTime
-       return $ ProxyConnection u selector closer concurrency now
+       -> Annex ProxyConnection
+openedProxyConnection u desc selector closer concurrency = do
+       now <- liftIO getPOSIXTime
+       fastDebug "P2P.Http" ("Opened proxy connection to " ++ desc)
+       return $ ProxyConnection u selector closer' concurrency now
+  where
+       closer' = do
+               fastDebug "P2P.Http" ("Closing proxy connection to " ++ desc)
+               closer
+               fastDebug "P2P.Http" ("Closed proxy connection to " ++ desc)
 
 openProxyConnectionToRemote
        :: AnnexWorkerPool
@@ -557,7 +564,8 @@ openProxyConnectionToRemote workerpool clientmaxversion bypass remote =
        inAnnexWorker' workerpool $ do
                remoteside <- proxyRemoteSide clientmaxversion bypass remote
                concurrencyconfig <- Proxy.noConcurrencyConfig
-               liftIO $ openedProxyConnection (Remote.uuid remote)
+               openedProxyConnection (Remote.uuid remote)
+                       ("remote " ++ Remote.name remote)
                        (Proxy.singleProxySelector remoteside)
                        (Proxy.closeRemoteSide remoteside)
                        concurrencyconfig
@@ -576,7 +584,8 @@ openProxyConnectionToCluster workerpool clientmaxversion bypass clusteruuid conc
                (proxyselector, closenodes) <-
                        clusterProxySelector clusteruuid clientmaxversion bypass
                concurrencyconfig <- Proxy.mkConcurrencyConfig concurrency
-               liftIO $ openedProxyConnection (fromClusterUUID clusteruuid)
+               openedProxyConnection (fromClusterUUID clusteruuid)
+                       ("cluster " ++ fromUUID (fromClusterUUID clusteruuid))
                        proxyselector closenodes concurrencyconfig
 
 type ProxyConnectionPool = (Integer, M.Map ProxyConnectionPoolKey [ProxyConnection])
index 54a37ca6513dd47027679dce9375ff7796ca36d4..83bc358a168f59b2717e12e0e5e2d188ebda789a 100644 (file)
@@ -32,7 +32,7 @@ Planned schedule of work:
   over http leaves open the connection to the cluster, so the next request
   opens another one.
 
-  So does an interrupted PUT directly to the proxied ;
+  So does an interrupted PUT directly to the proxied
   special remote over http.
 
 * When part of a file has been sent to a cluster via the http server,