Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-90034

Fix tracing of EncryptedDBClientBase.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc7
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • ALL
    • v8.0
    • Hide
      // repro.js
      var session;   /* from Top-level statement 111  */
      var kvDbName;  /* from Top-level statement 1750 */
      
      var $startTime = Date.now();
      try {
          var clientSideFLEOptions = {
              kmsProviders: {},
              keyVaultNamespace: kvDbName + '.keystore',
              schemaMap: {}
          };
      } catch (e) {
      }
      var $endTime = Date.now();
      print('Top-level statement 625 completed in', $endTime - $startTime, 'ms');
      
      var $startTime = Date.now();
      try {
          var initialConn = db.getMongo();
      } catch (e) {
      }
      var $endTime = Date.now();
      print('Top-level statement 880 completed in', $endTime - $startTime, 'ms');
      gc();
      
      var $startTime = Date.now();
      try {
          session(initialConn.setAutoEncryption(clientSideFLEOptions));
      } catch (e) {
      }
      var $endTime = Date.now();
      print('Top-level statement 1392 completed in', $endTime - $startTime, 'ms');
      gc();
      
      var $startTime = Date.now();
      try {
          initialConn.toggleAutoEncryption(true);
      } catch (e) {
      }
      var $endTime = Date.now();
      print('Top-level statement 1432 completed in', $endTime - $startTime, 'ms');
      gc();
      
      Show
      // repro.js var session; /* from Top-level statement 111 */ var kvDbName; /* from Top-level statement 1750 */ var $startTime = Date.now(); try { var clientSideFLEOptions = { kmsProviders: {}, keyVaultNamespace: kvDbName + '.keystore' , schemaMap: {} }; } catch (e) { } var $endTime = Date.now(); print( 'Top-level statement 625 completed in' , $endTime - $startTime, 'ms' ); var $startTime = Date.now(); try { var initialConn = db.getMongo(); } catch (e) { } var $endTime = Date.now(); print( 'Top-level statement 880 completed in' , $endTime - $startTime, 'ms' ); gc(); var $startTime = Date.now(); try { session(initialConn.setAutoEncryption(clientSideFLEOptions)); } catch (e) { } var $endTime = Date.now(); print( 'Top-level statement 1392 completed in' , $endTime - $startTime, 'ms' ); gc(); var $startTime = Date.now(); try { initialConn.toggleAutoEncryption( true ); } catch (e) { } var $endTime = Date.now(); print( 'Top-level statement 1432 completed in' , $endTime - $startTime, 'ms' ); gc();

      Tracing of the encrypted db client does not take place unless we toggle "toggleAutoEncryption" on in the connection. This can result in the encrypted db client object not being traced, and subsequently being GCd before we are done using it.

            Assignee:
            santiago.roche@mongodb.com Santiago Roche
            Reporter:
            santiago.roche@mongodb.com Santiago Roche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: