Skip to content

Concurrent executions can lead to race condition #105

@erickoledadevrel

Description

@erickoledadevrel

Some Gmail add-ons developers have reported that concurrent executions can lead to race conditions. When paging through emails quickly, you can load two instances of the add-on at the same time. If the access token is expired, both instances will attempt to refresh the token, resulting in two new tokens. Some OAuth providers invalidate old access and refresh tokens when new ones are granted, leading to cases where invalid tokens are persisted.

The workaround has been to using the LockService to prevent concurrent access to portions of code that could lead to a token refresh. These can be scattered throughout the codebase however, so ideally we'd have support for locking in the library itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions