Michael, I was looking for something else, but noticed that we're incrementing the DHANDLE ref count in __conn_dhandle_get(), before acquiring the lock (which can fail).
Here's a diff so it's clear what I'm asking.
*** conn/conn_dhandle.c.orig Fri Jun 7 16:11:13 2013
--- conn/conn_dhandle.c Sat Jun 8 14:11:01 2013
***************
*** 104,113 ****
((ckpt == NULL && dhandle->checkpoint == NULL) ||
(ckpt != NULL && dhandle->checkpoint != NULL &&
strcmp(ckpt, dhandle->checkpoint) == 0))) {
++dhandle->refcnt;
session->dhandle = dhandle;
! return (__conn_dhandle_open_lock(
! session, dhandle, flags));
}
/*
--- 104,114 ----
((ckpt == NULL && dhandle->checkpoint == NULL) ||
(ckpt != NULL && dhandle->checkpoint != NULL &&
strcmp(ckpt, dhandle->checkpoint) == 0))) {
+ WT_RET(
+ __conn_dhandle_open_lock(session, dhandle, flags));
++dhandle->refcnt;
session->dhandle = dhandle;
! return (0);
}
/*