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

Timeout may be too short in Db.scala, could it be included in the config? #6718

Closed
garyg1 opened this issue May 28, 2020 · 1 comment
Closed

Comments

@garyg1
Copy link

garyg1 commented May 28, 2020

I was setting up a development environment and ran into

play.api.UnexpectedException: Unexpected exception[TimeoutException: Future timed out after [5 seconds]]

Although the onboarding suggests it's an issue with the websocket connection, it was actually an issue with the MongoDB connection timeout being manually set to 5 seconds

private lazy val db: DefaultDB = Chronometer.syncEffect(
  driver
    .connect(uri, name.some)
    .flatMap(_ database dbName)
    .await(5.seconds, s"db:$name")
    // ...

I changed the line to 60 seconds and lila worked fine.

[info] db.main - MongoDB connected to lichess in 5627.00 ms

Is there a workaround for this besides manually changing the code? Is it possible that this could be added into base.config? Or added to the onboarding?

Environment

MacBook Pro 2015
macOS 10.14.6 (18G5033)
8 GB RAM
2.7 GHz Intel Core i5

[email protected], sbt, and redis installed with brew (Homebrew 2.2.17) and started using brew services.

@ornicar
Copy link
Collaborator

ornicar commented May 28, 2020

5s to connect to a database is already ridiculous. On dev, stage and prod, I see much faster connections.

Your setup is broken, I blame osx

@ornicar ornicar closed this as completed May 28, 2020
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

No branches or pull requests

2 participants