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

Sentry.close must be called in an isolate otherwise it won't shut down #2625

Open
buenaflor opened this issue Jan 28, 2025 · 3 comments
Open

Comments

@buenaflor
Copy link
Contributor

Description

"I'm calling Sentry.init in my isolate (the non-flutter variant) and found my isolate wouldn't shutdown until I added Sentry.close as the last line in the isolate."

Let's verify this first and then document it

@denrase
Copy link
Collaborator

denrase commented Feb 4, 2025

I tested with the following code.

import 'dart:isolate';
import 'package:sentry/sentry.dart';

Future<void> main(List<String> arguments) async {
  print('before sentry isolate');
  await Isolate.run(_sentryIsolate);
  print('after sentry isolate');
}

Future<void> _sentryIsolate() async {
  print('sentry isolate start');
  await Sentry.init((options) {
    options.dsn = 'https://[email protected]/5428562';
  });
  // await Sentry.close();
  print('sentry isolate end');
}

It makes no difference if we close sentry or not, the output is the same in both cases.

denis@MacBook-Pro metrics % ./perf_test_console_sentry.bin
before sentry isolate
sentry isolate start
sentry isolate end
after sentry isolate

@buenaflor Can we reach the user somehow to get a sample where this is occurring?

@denrase denrase moved this from In Investigation to Needs More Information in Mobile & Cross Platform SDK Feb 4, 2025
@buenaflor buenaflor moved this from Needs More Information to Needs Investigation in Mobile & Cross Platform SDK Feb 11, 2025
@buenaflor buenaflor moved this from Needs Investigation to Needs More Information in Mobile & Cross Platform SDK Feb 11, 2025
@buenaflor
Copy link
Contributor Author

cc @bsutton

@bsutton
Copy link

bsutton commented Feb 11, 2025

here is a link to the source file that had the problem.

https://github.com/bsutton/hmb/blob/wip/lib/database/management/backup_providers/zip_isolate.dart

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Status: Needs More Information
Development

No branches or pull requests

3 participants