Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRIVERS-2991 Properly kill old MO server to avoid "Address already in use" errors #504

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

ShaneHarvey
Copy link
Contributor

@ShaneHarvey ShaneHarvey commented Sep 25, 2024

DRIVERS-2991 Properly kill old MO server to avoid "Address already in use" errors.

The ss+awk solution doesn't work on RHEL 8 anymore for unknown reasons:

$ ss -tlnp 'sport = :8889'
State                           Recv-Q                           Send-Q                                                       Local Address:Port                                                       Peer Address:Port
LISTEN                          0                                5                                                                127.0.0.1:8889                                                            0.0.0.0:*                               users:(("mongo-orchestra",pid=7676,fd=5))
$ ss -tlnp 'sport = :8889' | awk 'NR>1 {split($7,a,","); print a[1]}'

Perhaps ss was updated and reports output differently than it used to? Or perhaps awk has changed? Either way using fuser should do the trick.

@durran
Copy link
Member

durran commented Sep 26, 2024

@ShaneHarvey ShaneHarvey changed the title DRIVERS-2991 Pin to bottle<0.13 to avoid "Address already in use" errors DRIVERS-2991 Properly kill old MO server to avoid "Address already in use" errors Sep 26, 2024
@ShaneHarvey
Copy link
Contributor Author

Believe I've found the real culprit. The ss+awk command to find/kill the running MO server doesn't work on RHEL 8 anymore for unknown reasons:

$ ss -tlnp 'sport = :8889'
State                           Recv-Q                           Send-Q                                                       Local Address:Port                                                       Peer Address:Port
LISTEN                          0                                5                                                                127.0.0.1:8889                                                            0.0.0.0:*                               users:(("mongo-orchestra",pid=7676,fd=5))
$ ss -tlnp 'sport = :8889' | awk 'NR>1 {split($7,a,","); print a[1]}'

Perhaps ss was updated and reports output differently than it used to? Or perhaps awk has changed? Either way using fuser should do the trick:

$ fuser 8889/tcp
8889/tcp:             8924
$ fuser --kill 8889/tcp
8889/tcp:             8924
$ fuser 8889/tcp

Testing via node here (with more tasks now): https://spruce.mongodb.com/version/66f591a5d6b5680007128d57/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

@nbbeeken
Copy link
Contributor

The worst time for us to now see some sporadic node download failures.. but as long as that patch doesn't show any deep purple, this should have fixed it. TY!

Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta catch em all but for "kill process by port" commands :) LGTM

@ShaneHarvey
Copy link
Contributor Author

ShaneHarvey commented Sep 26, 2024

Okay it looks much better but now mongod is sometimes failing to start with "Address already in use" (here):

 [2024/09/26 10:22:42.788] {"t":{"$date":"2024-09-26T17:19:42.436+00:00"},"s":"E",  "c":"STORAGE",  "id":20568,   "ctx":"initandlisten","msg":"Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"Address already in use"}}}

My guess is that we killed the old MO server but the mongod was still left running on that port.

@nbbeeken
Copy link
Contributor

We could merge this as is to get some of the issue unblocked, but any risk killing the typical db ports here?

@ShaneHarvey ShaneHarvey merged commit 3608d52 into mongodb-labs:master Sep 26, 2024
59 of 60 checks passed
@ShaneHarvey
Copy link
Contributor Author

I'll open a new PR for killing the old mongo servers.

@ShaneHarvey ShaneHarvey deleted the DRIVERS-2991 branch September 26, 2024 19:45
ShaneHarvey added a commit to ShaneHarvey/drivers-evergreen-tools that referenced this pull request Sep 26, 2024
adriandole pushed a commit to adriandole/drivers-evergreen-tools that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants