Skip to content

Decide on each particular machinery of debug mode and provide an additional feature flag for eachย #3677

Open
@qwwdfsad

Description

@qwwdfsad

Currently, when coroutines debug mode is enabled, the following machinery is enabled:

  • Every coroutine created is supplied with CoroutineId. This one might be useful for local debugging and logging, though its general applicability (i.e. for running applications of IDEA scale, the purpose of numeric id is unclear)
  • Stacktrace population for JobCancellationException is enabled, which is known to be a performance-hitter (we also know it from IDEA experience)
  • Thread.setName with coroutine id is invoked. This seemed to be the legacy of earlier days when we had little to no tooling around coroutines debugging. It has three downsides: it crashes ART consistently (Android ART Native Crash sometimes occurs when changing a threads nameย #2234), it might dominate coroutine-specific workloads (Android ART Native Crash sometimes occurs when changing a threads nameย #2234 (comment)), and it potentially interferes with code that leverages thread names.
  • Stacktrace recovery is enabled. I like this one and have no intention of tweaking it :)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions