Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-574

increment DHANDLE ref cnt on failure?

    • Type: Icon: Task Task
    • Resolution: Done
    • WT1.6.2
    • Affects Version/s: None
    • Component/s: None

      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);
        		}
        
        	/*
      

            Assignee:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: