OpenTreeOfLife / germinator

miscellaneous scripts and data for concerns that span more than one of the Open Tree code repositories: integration tests, system statistics, etc.
BSD 2-Clause "Simplified" License
21 stars 7 forks source link

oti (neo4j) fails to start, but it doesn't wait for 120-second timeout #136

Closed jimallman closed 6 years ago

jimallman commented 6 years ago

See this Gitter discussion for background and links to a bug tracker with the solution.

Short of upgrading Neo4j, or patching its control script in deployment, our temporary workaround is to downgrade lsof to an older version that's compatible. This seems reasonable, since we're transitioning away from Neo4j. But it's one more thing to keep track of.

jimallman commented 6 years ago

Just in case the above discussion is lost or just too confusing, here's the neo4j issue that pinpoints the problem with lsof >= 4.87

bredelings commented 6 years ago

The patch consists of replacing newpid=$(lsof -i :$NEO4J_SERVER_PORT -F T -Ts | grep -i "TST=LISTEN" -B1 | head -n1) with newpid=$(lsof -i :$NEO4J_SERVER_PORT -F T -Ts | grep "p") Also, the second line appears to work with earlier versions of lsof as well.

jimallman commented 6 years ago

Also, the second line appears to work with earlier versions of lsof as well.

Yes, but note that this can return multiple lines (process ids), which seems problematic:

$ sudo lsof -i :7478 -F T -Ts | grep "p"
p1381
p2633
p2634

I gather the one we're interested in is listed closest to TST=LISTEN in the full output:

$ sudo lsof -i :7478 -F T -Ts
p1381
TST=LISTEN
p2633
TST=CLOSE_WAIT
p2634
TST=CLOSE_WAIT
bredelings commented 6 years ago

Oh, I see.

jimallman commented 6 years ago

I think this captures the sense of what we're looking for:

$ sudo lsof -i :7478 -F T -Ts | grep "TST=LISTEN" -B4 | grep "^p" | tail -n1
p1381

In other words:

This should handle changes in order, multiple TST lines, etc.

EDIT TO ADD: So the patched line might look like so: newpid=$(lsof -i :$NEO4J_SERVER_PORT -F T -Ts | grep "TST=LISTEN" -B4 | grep "^p" | tail -n1)

mtholder commented 6 years ago

closing because of "won't fix"