Skip to content

Commit

Permalink
MB-13331: Go-couchbase UPR panic in some shutting down sequence
Browse files Browse the repository at this point in the history
Change-Id: I8d74d815c56f0c928b8f5e0e2485d10d2393d8ad
  • Loading branch information
Xiaomei-Zhang committed Feb 9, 2015
1 parent 8b578c9 commit f209822
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions upr.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ func (feed *UprFeed) forwardUprEvents(nodeFeed *FeedInfo, killSwitch chan bool,

defer func() {
feed.wg.Done()
if r := recover(); r != nil {
//if feed is not closing, re-throw the panic
if feed.outputClosed != true && feed.closing != true {
panic(r)
} else {
log.Printf("Panic is recovered. Since feed is closed, exit gracefully")

}
}
}()

for {
Expand Down

0 comments on commit f209822

Please sign in to comment.