Comment 8 for bug 1462550

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/11334
Committed: http://github.org/Juniper/contrail-controller/commit/35eb5306bad7087f3514b4a16bef686cca30f1c0
Submitter: Zuul
Branch: R2.20

commit 35eb5306bad7087f3514b4a16bef686cca30f1c0
Author: Nischal Sheth <email address hidden>
Date: Fri Jun 5 13:25:13 2015 -0700

Fix concurrency issue in BgpSession::WriteReady

It's possible that BgpSession::WriteReady gets called after peer
for the session has already been deleted. Prevent WriteReady from
from accessing freed memory by clearing the back pointer to the
peer in the session when the session in the peer is cleared.

The above fix is not sufficient since there's a concurrency issue
wherein BgpSession::WriteReady could try to access the peer while
the peer is trying to clear the back pointer in the session.

Fix is to enqueue sessions to a work queue in the sesison manager
when BgpSession::WriteReady is called. The work queue is processed
in the context of the bgp::Config task.

Change-Id: I6e4c72b1367914decddd0baf25589446171443bd
Closes-Bug: 1462550