Skip to content

fix(ndk): Keep the interrupt when SentryNdk waits for native libraries (JAVA-552) - #6667

Draft
runningcode wants to merge 2 commits into
9.x.xfrom
no/java-552-restore-interrupts
Draft

runningcode wants to merge 2 commits into
9.x.xfrom
no/java-552-restore-interrupts

Conversation

@runningcode

@runningcode runningcode commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

SentryNdk.init and SentryNdk.close wait for the native libraries to load, and wrap an InterruptedException in an IllegalStateException. They don't own the calling thread, so they now restore its interrupt flag first, for the code that does.

That's 2 sites. No other site in the audit needed only an interrupt fix. The three Future.get() catches in DefaultAndroidEventProcessor also restore the interrupt, but they're narrowings first, so they're in #6669.

💡 Motivation and Context

This is part of the catch (Throwable) audit. It replaces the interrupt fix in #6659.

This PR is independent of its siblings and they can merge in any order:

💚 How did you test it?

  • The existing unit tests of sentry-android-ndk.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

#skip-changelog

🤖 Generated with Claude Code

SentryNdk.init and close wrap an InterruptedException in an IllegalStateException. They don't own the calling thread, so they now restore its interrupt flag first, for the code that does.

Refs #5513

Refs JAVA-552

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown

JAVA-552

@sentry

sentry Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

Refs #5513

Refs JAVA-552

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 18, 2026

This branch has not been deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant