Repository navigation
Conversation
The boot sweep scheduled queued entries through schedule(), which does nothing when the entry's WorkManager chain already holds a run that has not started. A run left from an earlier process could then hold the entry back across every launch. The sweep now replaces the main chain. Wakes and entries whose worker runs in this process are left as before. RAD-16862 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Closing in favor of #57. Stale expiry wakes fill WorkManager's 20 JobScheduler slots and its in-process scheduler's 200-oldest window. A fresh row from this restart would sit behind them and still not run. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Jira: RAD-16862
On Android, a customer's queue of 89 captures has sat
queuedfor six days with 0 bytes sent. That's 534 entries. Every launch runs the boot sweep, and no entry has started a run since. Force-stops and long foreground sessions didn't help either.The sweep queued work through
schedule(). That call does nothing when the entry's WorkManager chain already holds a run that hasn't started. When such a run is left over from an earlier process and never starts, every later launch skips the entry. The logs can't confirm that this is what happened on the customer's phone, because they don't include WorkManager state. It is the one path in the library that drops a run without logging anything.Before: the boot sweep kept whatever WorkManager already held for a queued entry.
After: the boot sweep replaces each queued entry's main chain with a fresh run (
ExistingWorkPolicy.REPLACE). Long-backoff wakes and parked-entry wakes are kept as before. Runs scheduled at any other time still useschedule().What to look at
Scheduler.kt: the newrestart().QueueController.kt:scheduleRun(boot = true), which the sweep now calls.Decisions and trade-offs
Test Plan
./gradlew :react-native-background-upload:testDebugUnitTest: 307 tests, 0 failures. The sweep tests now assertrestart()rather thanschedule(). They also assert that a worker running in this process is not restarted.yarn lint:cipasses.🤖 Generated with Claude Code