Skip to content

Concurrency > 1 Errors #43

Description

@jeffmur

Continued #39 - TLDR: Solution is not scalable. Should only affect dart test --concurrency 16.

Simple Approach: The ErrorTranslator singleton C class stores an error_message that is set in C and read from Dart.

However, when running dart test, the default concurrency is 16. Meaning that at once, we can have up-to 16 instances of Dart Seal objects.

As a result, we may receive intermittent failures when concurrency > 1. This should not affect users as all C FFI calls are synchronous. If there are multiple instances, they would be invoked sequentially.

Potential Solutions:

  1. For each C function, pass Pointer as parameter.
    This race condition can be solved by creating / managing ErrorTranslator instances for ffi invocation. However this may be overkill.

  2. For each C function, pass string (char*) as parameter:
    Simple, and a bit more transparent. Would require some additional logic to capture errors + return string. May introduce ambiguous complexity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions