p2phttp uses a LRU for active repositories. It could be improved:

It's possible that a very slow transfer of a lot of data to a rarely used repository will result in the least recently used repository still being in use. It would be good to avoid blocking for a long time waiting for shutdown of that repository.

Here's how: Make activityEnd check if the PerRepoServerState is now idle. If so, move it from its current position in the LRU to the end of the LRU. So popLRU will always yield a state that is inactive. Unless every repo in it is active. --Joey

done