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

enabled timeout when fetch read-side offset #1278

Merged
merged 2 commits into from Mar 21, 2018

Conversation

octonato
Copy link
Member

Make sure that read-side processors don't keep waiting forever when fetching offset.

@@ -38,6 +38,9 @@ db.default {

# 5 * number of threads
maxConnections = 100

# if true, a Mbean for AsyncExecutor will be registered
registerMbeans = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decide to add it to this PR. This can be useful when debugging slick.

AsyncExecutor provides this option, but we were not using it.

}
scaladsl.Source
.fromFuture(futureOffset)
.initialTimeout(config.offsetTimeout)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If futureOffset never completes (because of any underlying bug) that Source will never start and therefore the RestartSource wrapping it will never restart.

The call to initialTimeout make sure that the Source fails if a first element (the offset) is not pushed throught it within the passed offsetTimeout (defaults to 5s)

@ignasi35
Copy link
Contributor

There seems to be a compile issue.

@ignasi35 ignasi35 merged commit 48a8a3c into lagom:master Mar 21, 2018
ignasi35 pushed a commit that referenced this pull request Mar 21, 2018
* enabled timeout when fetch read-side offset

* fixing test compilation
@ignasi35
Copy link
Contributor

Backported 1.4.x 6b139ff

@octonato octonato deleted the fix-restart-source branch August 8, 2018 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants