Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

incubator/mongodb-replicaset bootstrap init-container has a possible infinite loop #522

Closed

Description

@ljnelson

Hello; we found that the incubator/mongodb-replicaset chart's bootstrap init-container contains the seeds of an infinite loop.

In its on-start.sh file, a mongod instance is started and then there is a polling loop that checks to see if it is up yet. If that mongod instance does not in fact come up for some reason (well, if the mongo client cannot reach it), then this loop will never terminate. The init-container thus will never complete nor fail.

In our case, I was running the chart on minikube. I'm not sure why, but mongod dumped core (the core file vanished; not sure about that either), causing the loop to be entered. My best guess is that the amount of storage requested by default (10GB) was too much in some way; in any event, reducing that storage request to 1GB allowed me to get around the issue.

My minikube environment is on a Mac running VirtualBox (i.e. not via xhyve) if that matters.

I don't know enough about what seems like the complicated interplay between various processes in this chart to know exactly what to change in a pull request, but I wanted to raise the issue.

Activity

  1. foxish commented on Feb 23, 2017

    @foxish
    Member

    Thanks for raising the issue @ljnelson. I think this failure mode is inevitable but should be handled better as there are a host of reasons why mongod may not start. One way to get around it might be monitoring the mongod process, so that we know when it exits with an error and can fail the container.

    Do you have thoughts on other ways this could be fixed?

  2. ljnelson commented on Feb 24, 2017

    @ljnelson
    Author

    Well, my naïve eyes just say: you've got a loop that never terminates. Set it to terminate after 100,000 iterations or a timeout or something so that at least you get logs. That would be the dead simple fix. Obviously monitoring would be better.

  3. seanknox commented on May 25, 2017

    @seanknox
    Contributor

    Closing due to inactivity, feel free to re-open if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions