Skip to content

Race condition and inconsistencies in ConfigDBConnector_Native::db_connect #1066

@huanlev

Description

@huanlev

We observe the following issues in ConfigDBConnector_Native::db_connect():

  1. client.get(INIT_INDICATOR) is called before psubscribe(). Hence, it is possible for a client getting a stale INIT_INDICATOR value and miss the keyspace notification on subsequent update. Suggest to psubscribe() before reading the INIT_INDICATOR instead.
  2. initialized->empty() is used to check for the blocking/returning condition which is inconsistent with the check in docker_image_ctl.j2 in sonic-buildimage. Would this *initialized != "0" check be more accurate?

If these changes are reasonable, I can create a PR for them.

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