Skip to content

chore: add logging to help investigate hang - WPB-22986#4271

Open
samwyndham wants to merge 8 commits intorelease/cycle-4.15from
chore/add-logging-for-hang-WPB-22986
Open

chore: add logging to help investigate hang - WPB-22986#4271
samwyndham wants to merge 8 commits intorelease/cycle-4.15from
chore/add-logging-for-hang-WPB-22986

Conversation

@samwyndham
Copy link
Contributor

@samwyndham samwyndham commented Feb 5, 2026

BugWPB-22986 [iOS] WireSyncEngine: ZMUserSession.setUpSyncAgent(clientID:)

Issue

One of our common hangs is one which takes place in ZMUserSession.setUpSyncAgent(clientID:) due to a call to NSManagedObjectContext.performAndWait(_:) - see ticket for more details.

I'm unable to reproduce any issue here so with this PR I'm just adding some logging. My hope is to catch incidences of a hang in Beta so that I can investigate better what is happening via beta logs.

In this PR I also made some changes to WireLogger.measureTime to allow for working with non async code.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Test Results

3 995 tests   3 967 ✅  4m 17s ⏱️
  552 suites     27 💤
    5 files        1 ❌

For more details on these failures, see this check.

Results for commit f98a46d.

♻️ This comment has been updated with latest results.

Summary: workflow run #21744855282
Allure report (download zip): html-report-27601-chore_add-logging-for-hang-WPB-22986

Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

don't you have hang detection enabled to see hang in action

@samwyndham
Copy link
Contributor Author

samwyndham commented Feb 5, 2026

don't you have hang detection enabled to see hang in action

@netbe Yes I do but in all my tests I haven't yet got a hang in ZMUserSession.setUpSyncAgent(clientID:). It tends to finish in 0.004 seconds on my device

Screenshot 2026-02-05 at 14 19 33

@samwyndham samwyndham requested a review from netbe February 5, 2026 14:41
@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 5, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

testThatItParsesAllKnownRemoveParticipantErrorResponses() from WireRequestStrategyTests.RemoveParticipantActionHandlerTests (Datadog) (Fix with Cursor)
Crash: WireRequestStrategyTestHost at <external symbol>

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f98a46d | Docs | Was this helpful? Give us feedback!

Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

left a suggestion

@samwyndham samwyndham enabled auto-merge (squash) February 6, 2026 09:05
@samwyndham samwyndham disabled auto-merge February 6, 2026 09:10
@samwyndham samwyndham enabled auto-merge (squash) February 6, 2026 12:58
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

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

Successfully merging this pull request may close these issues.

3 participants