Page MenuHomePhabricator

Gerrit - Too many concurrent connections (8) - max. allowed: 8
Closed, DuplicatePublic

Description

When trying to test connection to Gerrit: ssh -p 29418 d3r1ck01@gerrit.wikimedia.org or fetch updates to my local MW repo: git pull, I get this error:

Received disconnect from <some-IP> port 29418:12: Too many concurrent connections (8) - max. allowed: 8

Not sure what exactly is going on. Running the command in verbose mode (with -v), shows that connection is established but not sure why it suddenly disconnects. Has anyone had this issue?

Event Timeline

I am not sure why the limit is 8 since historically we had it set to 4 but I digress. You have too many connections established:

$ ssh -p 29418 gerrit.wikimedia.org gerrit show-connections
Session    User            Remote Host
--------------------------------------------------------------
a6708250   d3r1ck01        X
866d3e77   d3r1ck01        X
2634928e   d3r1ck01        X
06394e87   d3r1ck01        X
66512ab5   d3r1ck01        X
464e6615   d3r1ck01        X
a64722f9   d3r1ck01        X
90a514f5   d3r1ck01        Y

I am pretty sure that is the same issue as T338810, I have manually closed the left over connections using:

ssh -p 29418 gerrit.wikimedia.org gerrit show-connections \
  |grep d3r1ck01 \
  |awk '{ print $1 }' \
  |xargs -n1 ssh -p 29418 gerrit.wikimedia.org gerrit close-connection

Please change you remote configuration to use https for fetching:

git remote set-url origin https://gerrit.wikimedia.org/r/mediawiki/core.git
git remote set-url --push ssh://gerrit.wikimedia.org:29418/mediawiki/core.git
hashar closed this task as a duplicate of Restricted Task.Aug 5 2024, 10:46 AM

Please change you remote configuration to use https for fetching:

git remote set-url origin https://gerrit.wikimedia.org/r/mediawiki/core.git
git remote set-url --push ssh://gerrit.wikimedia.org:29418/mediawiki/core.git

I appreciate your help on this one @hashar. I’ve applied your suggestion (pull from HTTPS, push to SSH). I adjusted the push command above to set the URL name and also added my Gerrit username in the SSH URL like so:

git remote set-url --push *origin* ssh://*d3r1ck01*@gerrit.wikimedia.org:29418/mediawiki/core.git

On the side, I’m also suspecting (without any logical proof) that a PHPStorm plugin - GitToolbox that I recently installed was doing multiple connections to Gerrit to do fetches across different repositories to detect out of date branches, branches that have diverged etc to propose them for cleanup on the PHPStorm IDE interface. Maybe it was overdoing stuff which created multiple connections without closing them causing this issue. I’ve disabled the tool (just in case).

On the side, I’m also suspecting (without any logical proof) that a PHPStorm plugin - GitToolbox that I recently installed was doing multiple connections to Gerrit to do fetches across different repositories to detect out of date branches, branches that have diverged etc to propose them for cleanup on the PHPStorm IDE interface. Maybe it was overdoing stuff which created multiple connections without closing them causing this issue. I’ve disabled the tool (just in case).

If your repositories have a remote fetch URL set to HTTPS, it is fine to use that feature. Those requests would hit Gerrit which in almost all case will respond out of its cache :)

Mentioned in SAL (#wikimedia-releng) [2024-10-08T08:30:13Z] <hashar> gerrit: closed all connections for user suecarmol due to T371749