-
Notifications
You must be signed in to change notification settings - Fork 61
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
Guard notifying outdated scheduler #1559
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b5a126f
Fix crashes when posting to released scheduler
rorbech f3e4ce3
Rework scheduler life cycle
rorbech f44046a
Clean up
rorbech 6d55eb6
Naming
rorbech 93be8fb
Fix test build errors
rorbech fc7b91e
Bump to latest core
rorbech 91e2120
Merge branch 'cr/fix-scheduler-crash' into releases
rorbech 0245904
Bump to latest BAAS
rorbech 1363ca7
Proper locking around posting to freed scheduler
rorbech 2f470cd
Remove usage of runTest
rorbech 5c7b52b
Merge branch 'releases' into cr/fix-scheduler-crash
rorbech 92c25d0
Fix macos tests
rorbech 9a4fc03
Add FIXME for bumping local BaaS SHA
rorbech 8782f9e
Bump core and SHA1 for local BaaS builds
rorbech 8dbcf5d
Change http timeout for debugging
rorbech 867db65
Enable debugging info
rorbech e243e36
Another round for linting
rorbech bc2df5d
Additional debug statements
rorbech 43fae5d
Changed timeout.
rorbech be6842c
Another round for linting
rorbech 367bbea
More debug output
rorbech 5623989
Fix timeout exceptions for debugging
rorbech 6b6c8a8
Clean up
rorbech cff6470
Revert http timeout
rorbech 7746087
Reinsert download guard
rorbech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Version of MongoDB Realm used by integration tests | ||
# See https://github.com/realm/ci/packages/147854 for available versions | ||
MONGODB_REALM_SERVER=2023-10-10 | ||
MONGODB_REALM_SERVER=2023-11-07 | ||
|
||
# `BAAS` and `BAAS-UI` projects commit hashes matching MONGODB_REALM_SERVER image version | ||
# note that the MONGODB_REALM_SERVER image is a nightly build, find the matching commits | ||
# for that date within the following repositories: | ||
# https://github.com/10gen/baas/ | ||
# https://github.com/10gen/baas-ui/ | ||
REALM_BAAS_GIT_HASH=8246fc548763eb908b8090df864e9924e3330a0d | ||
REALM_BAAS_UI_GIT_HASH=8a1843be2bf24f2faa705c5470a5bdd8d954f7ea | ||
REALM_BAAS_GIT_HASH=41fa6cdbca47826c20a64f756e21b2c184393e90 | ||
REALM_BAAS_UI_GIT_HASH=b97a27ac858e0e8126aeb63f6ff9734d11029a91 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule core
updated
74 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,10 @@ import io.realm.kotlin.Realm | |
import io.realm.kotlin.test.platform.PlatformUtils | ||
import io.realm.kotlin.types.RealmInstant | ||
import io.realm.kotlin.types.RealmObject | ||
import kotlinx.coroutines.TimeoutCancellationException | ||
import kotlinx.coroutines.channels.Channel | ||
import kotlinx.coroutines.withTimeout | ||
import kotlinx.coroutines.selects.onTimeout | ||
import kotlinx.coroutines.selects.select | ||
import kotlinx.datetime.Instant | ||
import kotlin.time.Duration | ||
import kotlin.time.Duration.Companion.minutes | ||
|
@@ -92,8 +94,12 @@ fun Instant.toRealmInstant(): RealmInstant { | |
} | ||
|
||
// Variant of `Channel.receiveOrFail()` that will will throw if a timeout is hit. | ||
suspend fun <T : Any?> Channel<T>.receiveOrFail(timeout: Duration = 1.minutes): T { | ||
return withTimeout(timeout) { | ||
receive() | ||
suspend fun <T : Any?> Channel<T>.receiveOrFail(timeout: Duration = 1.minutes, message: String? = null): T { | ||
return select { | ||
[email protected] { it } | ||
onTimeout(timeout) { | ||
@Suppress("invisible_member") | ||
throw TimeoutCancellationException("Timeout: $message") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch 🙈, but any reason you are adding a timeout? The first upload doesn't have one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it because it would highlight what action is actually not executing as expected instead of just timeout out on the recipient side. I just added if for the uploads that I inserted, but just didn't walk over the rest of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok 👍