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

The correlationId is not thread safe #1564

Closed
NicoleYarroch opened this issue Feb 20, 2020 · 1 comment · Fixed by #1570
Closed

The correlationId is not thread safe #1564

NicoleYarroch opened this issue Feb 20, 2020 · 1 comment · Fixed by #1570
Assignees
Labels
bug A defect in the library manager-lifecycle Relating to the manager layer - lifecycle manager
Projects

Comments

@NicoleYarroch
Copy link
Contributor

Bug Report

Multiple threads can access the nonatomic lastCorrelationId variable in the SDLLifecycleManager class. Since lastCorrelationId is not thread safe, this can result in core rejecting a request due to a duplicate correlation id.

Request failed: Show (request), id: 12
{
    mainField1 = "SmartDeviceLink (SDL)";
    mainField2 = "Swift Example App";
    mainField3 = "Odometer: Disallowed";
    mainField4 = "";
    mediaTrack = "";
    metadataTags = "{\n    mainField1 =     (\n    );\n    mainField2 =     (\n    );\n    mainField3 =     (\n    );\n}";
    templateTitle = Home;
}, response: Show (response), id: 12
{
    info = "Duplicate correlation_id";
    resultCode = "INVALID_ID";
    success = 0;
}, 
Reproduction Steps

Difficult to reproduce since this is a race condition.

  1. Connect any SDL app to a head unit or emulator. Watch logs for Duplicate correlation_id errors.
Expected Behavior

Core should never return a Duplicate correlation_id error.

Observed Behavior

A Duplicate correlation_id error is sometimes returned.

OS & Version Information
  • iOS Version: 13
  • SDL iOS Version: 6.5
  • Testing Against: SDL_Core v6.0.1
Test Case, Sample Code, and / or Example App

I saw this while testing the Swift example app in the library.

@NicoleYarroch NicoleYarroch added the bug A defect in the library label Feb 20, 2020
@joeljfischer joeljfischer added the manager-lifecycle Relating to the manager layer - lifecycle manager label Feb 24, 2020
joeljfischer added a commit that referenced this issue Feb 24, 2020
* Ensure that all RPC requests are sent on the processing queue to ensure protected resources are accessed synchronously from the same queue
@joeljfischer joeljfischer self-assigned this Feb 24, 2020
@joeljfischer joeljfischer linked a pull request Feb 25, 2020 that will close this issue
4 tasks
@NicoleYarroch
Copy link
Contributor Author

Fixed in PR #1570

@NicoleYarroch NicoleYarroch added this to Done in v6.6.0 via automation Feb 26, 2020
@joeljfischer joeljfischer mentioned this issue Apr 29, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library manager-lifecycle Relating to the manager layer - lifecycle manager
Projects
No open projects
v6.6.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants