Skip to content

rds: LDS+RDS(or other xDS transitively owned by listenerImpl) race ends in unknown behavior. #7902

@stevenzzzz

Description

@stevenzzzz

Bug Template

Title: Fast LDS tearing down a HCM may interact with RDS update callbacks on the fly in worker threads.

Description:

IIUC, there is a race condition that a RDS update propagation on worker threads may be interfered by the destruction of the RdsRouteConfigProvider on the main thread, which ends in seg-fault or other unknown behaviors.

Repro steps:

  • RDS propagates a configUpdate to workers, the posted callback is as following:
    tls_->runOnAllThreads(
    this, new_config -> void { tls_->getTyped().config_ = new_config; }
    }
  • LDS updates the active listener in main thread, tear down the RdsRouteConfigProvider, the "this" above is released.
  • A callback gets executed in a worker thread, ends in a seg-fault or a invalid address access.

I have some possible fix for this if this is a real issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions