Comment 5 for bug 1462550

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

Reviewed: https://review.opencontrail.org/11333
Committed: http://github.org/Juniper/contrail-controller/commit/f0ce42f34dfe550b36a9ee8df081c3296a4eade3
Submitter: Zuul
Branch: master

commit f0ce42f34dfe550b36a9ee8df081c3296a4eade3
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