Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OriginInfo assigned to Path objects is a pointer to the originating peer's info, which is populated by the FSM goroutine handling the peer's connection. This value is typically protected by the FSM lock, but in the event a path watch is running, it gets converted to a protobuf object in toPathAPI in a separate goroutine. This method reads from this same structure without any data synchronisation, leading to a data race. To ensure this cannot happen, this commit adds a line to clone the field before it is passed to the event watcher, ensuring the data race cannot occur.
- Loading branch information