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

Sync thread sometime hangs #7986

Closed
darkdh opened this issue Jan 30, 2020 · 2 comments · Fixed by brave/brave-core#4550
Closed

Sync thread sometime hangs #7986

darkdh opened this issue Jan 30, 2020 · 2 comments · Fixed by brave/brave-core#4550

Comments

@darkdh
Copy link
Member

darkdh commented Jan 30, 2020

The integration of chromium sync and brave sync relies on syncer::Syncer to tell js sync extension to poll or commit changes. The hanging happens when polling remote records.

Sync thread will be blocked until new records or no records passed back to syncer
syncer->js sync extension (Block): https://github.com/brave/brave-core/blob/370057c4df9f726fe2a2c47c7f6672ee6488db02/chromium_src/components/sync/engine_impl/syncer.cc#L31
js extension->sync (Signal): https://github.com/brave/brave-core/blob/370057c4df9f726fe2a2c47c7f6672ee6488db02/components/brave_sync/brave_profile_sync_service_impl.cc#L569

I don't know the specific STR but when the hanging happens syncer and js sync extension are waiting for each other causing a deadlock.
When that happens,

  1. js sync extension is idle, no new records coming in or out
  2. When browser shutdown, it waits for sync thread to end but it is hanging.

cc @AlexeyBarabash @bridiver @jsecretan

@btlechowski
Copy link

btlechowski commented Jan 31, 2020

I have experienced this issue few times. I was unable to relaunch the browser when this happened thus making Brave unusable.

Brave 1.3.106 Chromium: 79.0.3945.130 (Official Build) beta (64-bit)
Revision e22de67c28798d98833a7137c0e22876237fc40a-refs/branch-heads/3945@{#1047}
OS Windows 7 Service Pack 1 (Build 7601.24544)
Brave 1.5.75 Chromium: 80.0.3987.66 (Official Build) nightly (64-bit)
Revision 56ea77d65c47ecbb1180b99f860d85b51117864a-refs/branch-heads/3987@{#662}
OS Windows 7 Service Pack 1 (Build 7601.24544)

cc @brave/legacy_qa

@darkdh darkdh self-assigned this Feb 7, 2020
@kjozwiak kjozwiak added this to the 1.6.x - Nightly milestone Feb 10, 2020
@bbondy bbondy modified the milestones: 1.6.x - Beta, 1.7.x - Dev Mar 10, 2020
@kjozwiak
Copy link
Member

kjozwiak commented Mar 31, 2020

Verification PASSED on macOS 10.15.3 x64 Catalina using the following build:

Brave | 1.7.79 Chromium: 80.0.3987.149 (Official Build) dev (64-bit)
-- | --
Revision | 5f4eb224680e5d7dca88504586e9fd951840cac6-refs/branch-heads/3987_137@{#16}
OS | macOS Version 10.15.3 (Build 19D76)
  • Verified the STR/Cases outlined via Handle exceptions for polling process brave-core#4550 (comment) using the following combination:
    • 1.7.79 CR: 80.0.3987.149 <--> 1.5.115 CR: 80.0.3987.149 (Desktop Release)
    • 1.7.79 CR: 80.0.3987.149 <--> 1.5.116 CR: 80.0.3987.149 (Brave-Beta Android)
    • 1.7.79 CR: 80.0.3987.149 <--> 1.15 (20.03.05.14) (iOS Release)

Once the change from brave/brave-core#4550 (comment) has been applied into extensions/background.js:

Screen Shot 2020-03-31 at 2 24 34 PM

Once the change from brave/brave-core#4550 (comment) has been reverted from extensions/background.js:

Screen Shot 2020-03-31 at 2 32 22 PM


Verification passed on

Brave 1.7.82 Chromium: 80.0.3987.162 (Official Build) dev (64-bit)
Revision f2c5dd6138153bb0658091205bd1a1717f16081a-refs/branch-heads/3987@{#1034}
OS Windows 10 OS Version 1803 (Build 17134.523)
  • Verified between 1.7.82 Windows and 1.5.122 (Linux)

  • Verified between 1.7.82 Windows and 1.5.116 Android-Core-Beta

  • Verified between 1.7.82 Windows and 1.15 iOS

  • Without changes
    image

  • With changes
    image

  • Without changes and with changes and reverting back the changes
    image

Verification passed on

Brave 1.7.86 Chromium: 80.0.3987.163 (Official Build) (64-bit)
Revision e7fbe071abe9328cdce4ffedac9822435fbd3656-refs/branch-heads/3987@{#1037}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#4550

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment