supercharge / mongodb-github-action

Use MongoDB in GitHub Actions
MIT License
222 stars 46 forks source link

single-instance can complete before ready to accept connections #49

Closed brettmc closed 1 year ago

brettmc commented 1 year ago

I'm hitting a race condition when using this action (v1.9.0) in single-instance mode. It can take a few seconds before mongo is ready to accept connections, so if my dependant job starts too quickly, mongo in unavailable.

My workarounds so far:

  1. sleep to give mongo time to start
  2. use a replica set (which does test for readiness)

Could the single-instance mode run the same readiness check that replicaset mode does?

marcuspoehls commented 1 year ago

@brettmc Hey Brett, thank you for pointing this out. Good catch 👍 Can you please prepare a pull request to improve the single instance "ready" handling to wait until MongoDB is actually ready to accept connections?