Replies: 3 comments
-
After more desperate tries, I started to think (for the first time....haha) what we do what a "heavy-used-mongo-docker" normally doesn't do. We have around 3000 tests, each of these tests obviously needs clean test data, therefore we call almost in all tests and often even more than once (among others) these commands:
What I did now I replaced the
and the timeouts do not appear randomly anymore....however for me it's too early to celebrate. There were also other times when I thought I solved it and suddenly it happened again. Anyway is it possible that mongo cannot handle a lot of drops and recreations of the same collections in a short amount of time? |
Beta Was this translation helpful? Give feedback.
-
I am experiencing a very similar issue. Using mongodb in docker for an integration test suite. I can get through all the tests if I run them serially, but if I run them with any parallelization the mongod process on the mongodb container stops accepting connections. I can shell into the container and poke around - it's not using any resources, it's just doing nothing. Seems like a network/connection issue to me? Not sure how to debug further. |
Beta Was this translation helpful? Give feedback.
-
Honestly, I'm having a hard time seeing anything in our image that could be causing this -- we're installing upstream's stock packages, and at the time you are all seeing issues it's long-since running What I'd recommend is trying a community support forum that's dedicated to MongoDB and asking for help debugging further there (since we're clearly not going to be much use, given the amount of time it's taken me to even get back to this issue 😅). |
Beta Was this translation helpful? Give feedback.
-
We use the mongo image to run our e2e test stack, together with cypress.
Basically what we have is a various set of tests:
Since a long time we have again and again issues, that we get timeouts after the tests are running for a while... at some point I could fix this by specifically using the image
mongo:3.6.17
.... however now it doesn't work again...I'm not sure if it's even the problem of the image, but I'm desperate - I already lost so many hours trying to fix this and figure out what's going on.
The errors look something like this (this is now by using
command: --serviceExecutor adaptive
, but it doesn't matter, since it also happens without this):(also note the IP is generated by docker-compose, not hardcoded)
While the tests are running I can normally also connect to this mongo image by using this command:
mongo mongodb://192.168.224.3:27017
However once I try this after the first timeout from above occurred then it hangs forever and it never connects.
Maybe of interest is also, that I can still ping this IP-address.
Any help and or pointers are greatly appreciated.
This is my
docker-compose
file:This is how we connect from the client (js). Note that we try to cache connections, and NEVER close them manually (until docker-compose is done and we remove the images again), I read that it is "best practice":
This is how we connect from the api (c#) - the service is a singleton, so the connection should only be opened once:
EDIT:
Now I ran it with
And it seemd to crash even earlier, attached the logs I got via
docker logs <imagename>
mongo-log.txt
Beta Was this translation helpful? Give feedback.
All reactions