Hello Jean-Daniel Cryans,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/2059

to review the following change.

Change subject: Fix SEGV in catalog manager when sending AddTablet requests
......................................................................

Fix SEGV in catalog manager when sending AddTablet requests

This fixes a SEGV seen in a test cluster due to the following race:

- we create an AsyncAddTablet task
- we call task->Run()
- the task executes very quickly, and deletes itself
- we try to log task->description(), which has already been deleted

This is a simple fix which wraps the task in a scoped_refptr so it stays alive
long enough to log. I also did the same to a few other tasks in the same file,
even though I didn't spot potential crashes. Better to be safe here instead of
deal with raw pointers.

I was able to reproduce the crash by adding a 50ms sleep after the task->Run()
call, and this patch fixed it. I didn't write a test to inject that sleep, since
this kind of bug would be unlikely to regress.

Change-Id: I9fefad72ed1a94e55e3079265ccc7a50a6bdd8ac
---
M src/kudu/master/catalog_manager.cc
1 file changed, 9 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/59/2059/1
-- 
To view, visit http://gerrit.cloudera.org:8080/2059
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fefad72ed1a94e55e3079265ccc7a50a6bdd8ac
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Jean-Daniel Cryans

Reply via email to