]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #16755 from ivancich/wip-pull-new-dmclock 16922/head
authorGregory Farnum <greg@gregs42.com>
Tue, 8 Aug 2017 21:27:28 +0000 (14:27 -0700)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 8 Aug 2017 21:52:11 +0000 (17:52 -0400)
osd: bring in dmclock library changes

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit 25f1edefbf21f17f5501d9894f0c4979c04b3f08)

16 files changed:
src/common/mClockPriorityQueue.h
src/dmclock/CMakeLists.txt
src/dmclock/cmake/modules/BuildGTest.cmake [new file with mode: 0644]
src/dmclock/sim/src/sim_client.h
src/dmclock/sim/src/sim_server.h
src/dmclock/sim/src/ssched/ssched_server.h
src/dmclock/sim/src/test_dmclock_main.cc
src/dmclock/sim/src/test_ssched_main.cc
src/dmclock/src/CMakeLists.txt
src/dmclock/src/dmclock_client.h
src/dmclock/src/dmclock_server.h
src/dmclock/src/dmclock_util.h
src/dmclock/test/CMakeLists.txt
src/dmclock/test/dmcPrCtl.h [new file with mode: 0644]
src/dmclock/test/dmtest-config.h.in [new file with mode: 0644]
src/dmclock/test/test_dmclock_server.cc

index b651cf08f4e85474f866c82b80a2fffb5a97ec88..7f7b7c35b5c8c1fdebdfd3417ad21a71b0c331b0 100644 (file)
@@ -298,7 +298,7 @@ namespace ceph {
 
     void enqueue(K cl, unsigned priority, unsigned cost, T item) override final {
       // priority is ignored
-      queue.add_request(item, cl, cost);
+      queue.add_request(std::move(item), cl, cost);
     }
 
     void enqueue_front(K cl,
index 9444ea1e96afd0a27250d6d989a0b41f797cdcd2..d133bc6b015067e30169952680045618dc56247b 100644 (file)
@@ -2,9 +2,19 @@ cmake_minimum_required(VERSION 2.8.11)
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
 
+set(CMAKE_CXX_FLAGS
+  "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-write-strings -Wall -pthread")
+
+if(DO_NOT_DELAY_TAG_CALC)
+  add_definitions(-DDO_NOT_DELAY_TAG_CALC)
+endif()
+
 if (NOT(TARGET gtest AND TARGET gtest_main))
-  if(NOT(GTEST_FOUND))
-    find_package(GTest REQUIRED)
+  if (NOT GTEST_FOUND)
+    find_package(GTest QUIET)
+    if (NOT GTEST_FOUND)
+      include(BuildGTest)
+    endif()
   endif()
 endif()
 
@@ -12,7 +22,6 @@ if (NOT(BOOST_FOUND))
   find_package(Boost REQUIRED)
 endif()
 
-# add_subdirectory(support/src)
 add_subdirectory(src)
 add_subdirectory(sim)
 
diff --git a/src/dmclock/cmake/modules/BuildGTest.cmake b/src/dmclock/cmake/modules/BuildGTest.cmake
new file mode 100644 (file)
index 0000000..356c7d5
--- /dev/null
@@ -0,0 +1,67 @@
+macro(_build_gtest gtest_root)
+  include(ExternalProject)
+  ExternalProject_Add(googletest
+    SOURCE_DIR ${gtest_root}
+    CMAKE_ARGS -DBUILD_GMOCK=OFF -DBUILD_GTEST=ON
+    INSTALL_COMMAND ""
+    LOG_CONFIGURE ON
+    LOG_BUILD ON)
+
+  ExternalProject_Get_Property(googletest source_dir)
+  set(GTEST_INCLUDE_DIRS ${source_dir}/googletest/include)
+  set(GMOCK_INCLUDE_DIRS ${source_dir}/googlemock/include)
+
+  find_package(Threads REQUIRED)
+
+  ExternalProject_Get_Property(googletest binary_dir)
+  set(GTEST_LIBRARY_PATH ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest.a)
+  set(GTEST_LIBRARY gtest)
+  add_library(${GTEST_LIBRARY} STATIC IMPORTED)
+  set_target_properties(${GTEST_LIBRARY} PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}"
+    IMPORTED_LOCATION ${GTEST_LIBRARY_PATH}
+    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+    IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+  add_dependencies(${GTEST_LIBRARY} googletest)
+  set(GTEST_LIBRARIES ${GTEST_LIBRARY})
+
+  set(GTEST_MAIN_LIBRARY_PATH ${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main.a)
+  set(GTEST_MAIN_LIBRARY gtest_main)
+  add_library(${GTEST_MAIN_LIBRARY} STATIC IMPORTED)
+  set_target_properties(${GTEST_MAIN_LIBRARY} PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}"
+    IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY_PATH}
+    IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+  add_dependencies(${GTEST_MAIN_LIBRARY} googletest)
+
+  set(GMOCK_LIBRARY_PATH ${binary_dir}/googlemock/${CMAKE_FIND_LIBRARY_PREFIXES}gmock.a)
+  set(GMOCK_LIBRARY gmock)
+  add_library(${GMOCK_LIBRARY} STATIC IMPORTED)
+  set_target_properties(${GMOCK_LIBRARY} PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES "${GMOCK_INCLUDE_DIRS}"
+    IMPORTED_LOCATION "${GMOCK_LIBRARY_PATH}"
+    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+    IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+  add_dependencies(${GMOCK_LIBRARY} googletest)
+
+  set(GMOCK_MAIN_LIBRARY_PATH ${binary_dir}/googlemock/${CMAKE_FIND_LIBRARY_PREFIXES}gmock_main.a)
+  set(GMOCK_MAIN_LIBRARY gmock_main)
+  add_library(${GMOCK_MAIN_LIBRARY} STATIC IMPORTED)
+  set_target_properties(${GMOCK_MAIN_LIBRARY} PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES "${GMOCK_INCLUDE_DIRS}"
+    IMPORTED_LOCATION ${GMOCK_MAIN_LIBRARY_PATH}
+    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+    IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+  add_dependencies(${GMOCK_MAIN_LIBRARY} ${GTEST_LIBRARY})
+endmacro()
+
+find_path(GTEST_ROOT src/gtest.cc
+  HINTS $ENV{GTEST_ROOT}
+  PATHS /usr/src/googletest/googletest /usr/src/gtest)
+
+if(EXISTS ${GTEST_ROOT})
+  message(STATUS "Found googletest: ${GTEST_ROOT}")
+  _build_gtest(${GTEST_ROOT})
+else()
+  message(SEND_ERROR "Could NOT find googletest")
+endif()
index 6538dab2c0811a69a372fb01238330fce0a60acf..fd4a81c76dac1a498ebaed534d2bc454514be059 100644 (file)
@@ -89,7 +89,7 @@ namespace crimson {
 
       using SubmitFunc =
        std::function<void(const ServerId&,
-                          const TestRequest&,
+                          TestRequest&&,
                           const ClientId&,
                           const ReqPm&)>;
 
@@ -240,8 +240,9 @@ namespace crimson {
              count_stats(internal_stats.mtx,
                          internal_stats.get_req_params_count);
 
-             TestRequest req(server, o, 12);
-             submit_f(server, req, id, rp);
+             submit_f(server,
+                      TestRequest{server, static_cast<uint32_t>(o), 12},
+                      id, rp);
              ++outstanding_ops;
              l.lock(); // lock for return to top of loop
 
index e318d6e90ac328e6810aa4b7a1fc4f628003ee37..42b5269d780323085c3d807ce1a5c84b0c7cc8ab 100644 (file)
@@ -147,14 +147,15 @@ namespace crimson {
        delete priority_queue;
       }
 
-      void post(const TestRequest& request,
+      void post(TestRequest&& request,
                const ClientId& client_id,
                const ReqPm& req_params)
       {
        time_stats(internal_stats.mtx,
                   internal_stats.add_request_time,
                   [&](){
-                    priority_queue->add_request(request, client_id, req_params);
+                    priority_queue->add_request(std::move(request),
+                                                client_id, req_params);
                   });
        count_stats(internal_stats.mtx,
                    internal_stats.add_request_count);
@@ -202,10 +203,9 @@ namespace crimson {
            // notify server of completion
            std::this_thread::sleep_for(op_time);
 
-           TestResponse resp(req->epoch);
            // TODO: rather than assuming this constructor exists, perhaps
            // pass in a function that does this mapping?
-           client_resp_f(client, resp, id, additional);
+           client_resp_f(client, TestResponse{req->epoch}, id, additional);
 
            time_stats(internal_stats.mtx,
                       internal_stats.request_complete_time,
index ee4c1e6e3efff40df6d0f81aba10c50e90d24ff7..610c2ef665c432ad1b2a9a9d6be4c7ebc0337a21 100644 (file)
@@ -100,10 +100,11 @@ namespace crimson {
        finishing = true;
       }
 
-      void add_request(const R& request,
+      void add_request(R&& request,
                       const C& client_id,
                       const ReqParams& req_params) {
-       add_request(RequestRef(new R(request)), client_id, req_params);
+       add_request(RequestRef(new R(std::move(request))),
+                   client_id, req_params);
       }
 
       void add_request(RequestRef&& request,
index 668869b8d72fb040d3b74997db89a071e0f9a72a..57b733e860cede4065a36d2ad2034450c35f8399 100644 (file)
@@ -136,11 +136,11 @@ int main(int argc, char* argv[]) {
     // lambda to post a request to the identified server; called by client
     test::SubmitFunc server_post_f =
         [&simulation](const ServerId& server,
-                      const sim::TestRequest& request,
+                      sim::TestRequest&& request,
                       const ClientId& client_id,
                       const test::dmc::ReqParams& req_params) {
         test::DmcServer& s = simulation->get_server(server);
-        s.post(request, client_id, req_params);
+        s.post(std::move(request), client_id, req_params);
     };
 
     std::vector<std::vector<sim::CliInst>> cli_inst;
index 6df20dc5f896eac656e594c8f8b5b69a38e29424..14ff7e9b47040eef906489d7352746506759a4a3 100644 (file)
@@ -67,11 +67,11 @@ int main(int argc, char* argv[]) {
   // lambda to post a request to the identified server; called by client
   test::SubmitFunc server_post_f =
     [&simulation](const ServerId& server_id,
-                 const sim::TestRequest& request,
+                 sim::TestRequest&& request,
                  const ClientId& client_id,
                  const ssched::ReqParams& req_params) {
     auto& server = simulation->get_server(server_id);
-    server.post(request, client_id, req_params);
+    server.post(std::move(request), client_id, req_params);
   };
 
   static std::vector<sim::CliInst> no_wait =
index 7178f266e2a41d13276ad1fbe3a92bc49135cd37..65d09f6a46915d05405a4f540dbc1261f059fea1 100644 (file)
@@ -2,23 +2,9 @@ include_directories(${GTEST_INCLUDE_DIRS})
 include_directories(${Boost_INCLUDE_DIRS})
 include_directories(../support/src)
 
-set(local_flags "-std=c++11 -Wno-write-strings -Wall -pthread")
-
-if(DO_NOT_DELAY_TAG_CALC)
-  set(local_flags "${local_flags} -DDO_NOT_DELAY_TAG_CALC")
-endif()
+set(CMAKE_CXX_FLAGS
+  "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-write-strings -Wall -pthread")
 
 set(dmc_srcs dmclock_util.cc ../support/src/run_every.cc)
 
-set_source_files_properties(${dmc_srcs}
-  PROPERTIES
-  COMPILE_FLAGS "${local_flags}"
-  )
-
-if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-  set(warnings_off " -Wno-unused-variable -Wno-unused-function")
-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-  set(warnings_off " -Wno-unused-but-set-variable -Wno-unused-function")
-endif()
-
 add_library(dmclock STATIC ${dmc_srcs})
index b44e1211b53f667daf23a8ed651480f4574a931d..92f4cf83bb1abbdad5c792b5377258f9227dd653 100644 (file)
@@ -19,8 +19,6 @@
 #include "dmclock_util.h"
 #include "dmclock_recs.h"
 
-#include "gtest/gtest_prod.h"
-
 
 namespace crimson {
   namespace dmclock {
@@ -57,7 +55,8 @@ namespace crimson {
     // S is server identifier type
     template<typename S>
     class ServiceTracker {
-      FRIEND_TEST(dmclock_client, server_erase);
+      // we don't want to include gtest.h just for FRIEND_TEST
+      friend class dmclock_client_server_erase_Test;
 
       using TimePoint = decltype(std::chrono::steady_clock::now());
       using Duration = std::chrono::milliseconds;
index 8aaad3977264847c0c3351d76eff05da7d629171..2c9940dc6c17f8af7ff6c9b990951a7672ddb547 100644 (file)
@@ -50,8 +50,6 @@
 #include "profile.h"
 #endif
 
-#include "gtest/gtest_prod.h"
-
 
 namespace crimson {
 
@@ -235,7 +233,8 @@ namespace crimson {
     // branching factor
     template<typename C, typename R, uint B>
     class PriorityQueueBase {
-      FRIEND_TEST(dmclock_server, client_idle_erase);
+      // we don't want to include gtest.h just for FRIEND_TEST
+      friend class dmclock_server_client_idle_erase_Test;
 
     public:
 
@@ -371,12 +370,12 @@ namespace crimson {
 
        // NB: because a deque is the underlying structure, this
        // operation might be expensive
-       bool remove_by_req_filter_fw(std::function<bool(const R&)> filter_accum) {
+       bool remove_by_req_filter_fw(std::function<bool(R&&)> filter_accum) {
          bool any_removed = false;
          for (auto i = requests.begin();
               i != requests.end();
               /* no inc */) {
-           if (filter_accum(*i->request)) {
+           if (filter_accum(std::move(*i->request))) {
              any_removed = true;
              i = requests.erase(i);
            } else {
@@ -388,12 +387,12 @@ namespace crimson {
 
        // NB: because a deque is the underlying structure, this
        // operation might be expensive
-       bool remove_by_req_filter_bw(std::function<bool(const R&)> filter_accum) {
+       bool remove_by_req_filter_bw(std::function<bool(R&&)> filter_accum) {
          bool any_removed = false;
          for (auto i = requests.rbegin();
               i != requests.rend();
               /* no inc */) {
-           if (filter_accum(*i->request)) {
+           if (filter_accum(std::move(*i->request))) {
              any_removed = true;
              i = decltype(i){ requests.erase(std::next(i).base()) };
            } else {
@@ -404,7 +403,7 @@ namespace crimson {
        }
 
        inline bool
-       remove_by_req_filter(std::function<bool(const R&)> filter_accum,
+       remove_by_req_filter(std::function<bool(R&&)> filter_accum,
                             bool visit_backwards) {
          if (visit_backwards) {
            return remove_by_req_filter_bw(filter_accum);
@@ -478,7 +477,7 @@ namespace crimson {
       }
 
 
-      bool remove_by_req_filter(std::function<bool(const R&)> filter_accum,
+      bool remove_by_req_filter(std::function<bool(R&&)> filter_accum,
                                bool visit_backwards = false) {
        bool any_removed = false;
        DataGuard g(data_mtx);
@@ -500,14 +499,14 @@ namespace crimson {
 
 
       // use as a default value when no accumulator is provide
-      static void request_sink(const R& req) {
+      static void request_sink(R&& req) {
        // do nothing
       }
 
 
       void remove_by_client(const C& client,
                            bool reverse = false,
-                           std::function<void (const R&)> accum = request_sink) {
+                           std::function<void (R&&)> accum = request_sink) {
        DataGuard g(data_mtx);
 
        auto i = client_map.find(client);
@@ -518,13 +517,13 @@ namespace crimson {
          for (auto j = i->second->requests.rbegin();
               j != i->second->requests.rend();
               ++j) {
-           accum(*j->request);
+           accum(std::move(*j->request));
          }
        } else {
          for (auto j = i->second->requests.begin();
               j != i->second->requests.end();
               ++j) {
-           accum(*j->request);
+           accum(std::move(*j->request));
          }
        }
 
@@ -881,7 +880,9 @@ namespace crimson {
        ClientRec& top = heap.top();
 
        RequestRef request = std::move(top.next_request().request);
+#ifndef DO_NOT_DELAY_TAG_CALC
        RequestTag tag = top.next_request().tag;
+#endif
 
        // pop request and adjust heaps
        top.pop_request();
@@ -1162,11 +1163,11 @@ namespace crimson {
       }
 
 
-      inline void add_request(const R& request,
+      inline void add_request(R&& request,
                              const C& client_id,
                              const ReqParams& req_params,
                              double addl_cost = 0.0) {
-       add_request(typename super::RequestRef(new R(request)),
+       add_request(typename super::RequestRef(new R(std::move(request))),
                    client_id,
                    req_params,
                    get_time(),
@@ -1174,11 +1175,11 @@ namespace crimson {
       }
 
 
-      inline void add_request(const R& request,
+      inline void add_request(R&& request,
                              const C& client_id,
                              double addl_cost = 0.0) {
        static const ReqParams null_req_params;
-       add_request(typename super::RequestRef(new R(request)),
+       add_request(typename super::RequestRef(new R(std::move(request))),
                    client_id,
                    null_req_params,
                    get_time(),
@@ -1187,12 +1188,12 @@ namespace crimson {
 
 
 
-      inline void add_request_time(const R& request,
+      inline void add_request_time(R&& request,
                                   const C& client_id,
                                   const ReqParams& req_params,
                                   const Time time,
                                   double addl_cost = 0.0) {
-       add_request(typename super::RequestRef(new R(request)),
+       add_request(typename super::RequestRef(new R(std::move(request))),
                    client_id,
                    req_params,
                    time,
@@ -1255,11 +1256,9 @@ namespace crimson {
        switch(next.type) {
        case super::NextReqType::none:
          return result;
-         break;
        case super::NextReqType::future:
          result.data = next.when_ready;
          return result;
-         break;
        case super::NextReqType::returning:
          // to avoid nesting, break out and let code below handle this case
          break;
@@ -1402,11 +1401,11 @@ namespace crimson {
 
     public:
 
-      inline void add_request(const R& request,
+      inline void add_request(R&& request,
                              const C& client_id,
                              const ReqParams& req_params,
                              double addl_cost = 0.0) {
-       add_request(typename super::RequestRef(new R(request)),
+       add_request(typename super::RequestRef(new R(std::move(request))),
                    client_id,
                    req_params,
                    get_time(),
index d12c6f9eb63c9a61b9ae6446386c3d27b82137d4..c46d09f39319a53e96f936abd25bb11e241c8110 100644 (file)
@@ -30,11 +30,19 @@ namespace crimson {
 
 
     inline Time get_time() {
+#if defined(__linux__)
+      struct timespec now;
+      auto result = clock_gettime(CLOCK_REALTIME, &now);
+      (void) result; // reference result in case assert is compiled out
+      assert(0 == result);
+      return now.tv_sec + (now.tv_nsec / 1.0e9);
+#else
       struct timeval now;
       auto result = gettimeofday(&now, NULL);
-      (void) result;
+      (void) result; // reference result in case assert is compiled out
       assert(0 == result);
-      return now.tv_sec + (now.tv_usec / 1000000.0);
+      return now.tv_sec + (now.tv_usec / 1.0e6);
+#endif
     }
 
     std::string format_time(const Time& time, uint modulo = 1000);
index 24da2e7320a5d02343355ee442b825a424bdbf17..aff35d5d77581ccfd918ead823efd75beaa7fa4c 100644 (file)
@@ -1,3 +1,8 @@
+INCLUDE (CheckIncludeFiles)
+CHECK_INCLUDE_FILES("sys/prctl.h" HAVE_SYS_PRCTL_H)
+CONFIGURE_FILE(dmtest-config.h.in dmtest-config.h)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
 include_directories(../src)
 include_directories(../support/src)
 include_directories(../sim/src)
@@ -15,6 +20,7 @@ set_source_files_properties(${core_srcs} ${test_srcs}
   )
 
 add_executable(dmclock-tests ${test_srcs} ${support_srcs})
+target_include_directories(dmclock-tests PRIVATE "${GTEST_INCLUDE_DIRS}")
 
 if (TARGET gtest AND TARGET gtest_main)
   add_dependencies(dmclock-tests gtest gtest_main)
diff --git a/src/dmclock/test/dmcPrCtl.h b/src/dmclock/test/dmcPrCtl.h
new file mode 100644 (file)
index 0000000..39f9829
--- /dev/null
@@ -0,0 +1,42 @@
+// essentially the same as ceph's PrCtl.h, copied into the dmclock library
+
+#include <dmtest-config.h>
+#ifdef HAVE_SYS_PRCTL_H
+#include <iostream>
+#include <sys/prctl.h>
+#include <errno.h>
+
+struct PrCtl {
+  int saved_state = -1;
+  int set_dumpable(int new_state) {
+    int r = prctl(PR_SET_DUMPABLE, new_state);
+    if (r) {
+      r = -errno;
+      std::cerr << "warning: unable to " << (new_state ? "set" : "unset")
+                << " dumpable flag: " << strerror(r)
+                << std::endl;
+    }
+    return r;
+  }
+  PrCtl(int new_state = 0) {
+    int r = prctl(PR_GET_DUMPABLE);
+    if (r == -1) {
+      r = errno;
+      std::cerr << "warning: unable to get dumpable flag: " << strerror(r)
+                << std::endl;
+    } else if (r != new_state) {
+      if (!set_dumpable(new_state)) {
+        saved_state = r;
+      }
+    }
+  }
+  ~PrCtl() {
+    if (saved_state < 0) {
+      return;
+    }
+    set_dumpable(saved_state);
+  }
+};
+#else
+struct PrCtl {};
+#endif
diff --git a/src/dmclock/test/dmtest-config.h.in b/src/dmclock/test/dmtest-config.h.in
new file mode 100644 (file)
index 0000000..ecd2044
--- /dev/null
@@ -0,0 +1,2 @@
+/* Define to 1 if you have the <sys/prctl.h> header file. */
+#cmakedefine HAVE_SYS_PRCTL_H 1
index 4555e377323e9ff87af6341efb47740ea60207cc..95def410fb69f44ded3f78b6d8962bdf170506b9 100644 (file)
@@ -16,6 +16,9 @@
 #include "dmclock_util.h"
 #include "gtest/gtest.h"
 
+// process control to prevent core dumps during gtest death tests
+#include "dmcPrCtl.h"
+
 
 namespace dmc = crimson::dmclock;
 
@@ -61,17 +64,19 @@ namespace crimson {
       };
 
       QueueRef pq(new Queue(client_info_f, false));
-      Request req;
       ReqParams req_params(1,1);
 
-      EXPECT_DEATH_IF_SUPPORTED(pq->add_request(req, client1, req_params),
+      // Disable coredumps
+      PrCtl unset_dumpable;
+
+      EXPECT_DEATH_IF_SUPPORTED(pq->add_request(Request{}, client1, req_params),
                                "Assertion.*reservation.*max_tag.*"
                                "proportion.*max_tag") <<
        "we should fail if a client tries to generate a reservation tag "
        "where reservation and proportion are both 0";
 
 
-      EXPECT_DEATH_IF_SUPPORTED(pq->add_request(req, client2, req_params),
+      EXPECT_DEATH_IF_SUPPORTED(pq->add_request(Request{}, client2, req_params),
                                "Assertion.*reservation.*max_tag.*"
                                "proportion.*max_tag") <<
        "we should fail if a client tries to generate a reservation tag "
@@ -548,14 +553,13 @@ namespace crimson {
 
       pq = QueueRef(new Queue(client_info_f, false));
 
-      Request req;
       ReqParams req_params(1,1);
 
       auto now = dmc::get_time();
 
       for (int i = 0; i < 5; ++i) {
-       pq->add_request(req, client1, req_params);
-       pq->add_request(req, client2, req_params);
+       pq->add_request(Request{}, client1, req_params);
+       pq->add_request(Request{}, client2, req_params);
        now += 0.0001;
       }
 
@@ -602,15 +606,14 @@ namespace crimson {
 
       QueueRef pq(new Queue(client_info_f, false));
 
-      Request req;
       ReqParams req_params(1,1);
 
       // make sure all times are well before now
       auto old_time = dmc::get_time() - 100.0;
 
       for (int i = 0; i < 5; ++i) {
-       pq->add_request_time(req, client1, req_params, old_time);
-       pq->add_request_time(req, client2, req_params, old_time);
+       pq->add_request_time(Request{}, client1, req_params, old_time);
+       pq->add_request_time(Request{}, client2, req_params, old_time);
        old_time += 0.001;
       }
 
@@ -661,7 +664,6 @@ namespace crimson {
 
       QueueRef pq(new Queue(client_info_f, false));
 
-      Request req;
       ReqParams req_params(1,1);
 
       // make sure all times are well before now
@@ -669,8 +671,8 @@ namespace crimson {
 
       // add six requests; for same client reservations spaced one apart
       for (int i = 0; i < 3; ++i) {
-       pq->add_request_time(req, client1, req_params, start_time);
-       pq->add_request_time(req, client2, req_params, start_time);
+       pq->add_request_time(Request{}, client1, req_params, start_time);
+       pq->add_request_time(Request{}, client2, req_params, start_time);
       }
 
       Queue::PullReq pr = pq->pull_request(start_time + 0.5);
@@ -744,13 +746,12 @@ namespace crimson {
 
       QueueRef pq(new Queue(client_info_f, false));
 
-      Request req;
       ReqParams req_params(1,1);
 
       // make sure all times are well before now
       auto now = dmc::get_time();
 
-      pq->add_request_time(req, client1, req_params, now + 100);
+      pq->add_request_time(Request{}, client1, req_params, now + 100);
       Queue::PullReq pr = pq->pull_request(now);
 
       EXPECT_EQ(Queue::NextReqType::future, pr.type);
@@ -776,13 +777,12 @@ namespace crimson {
 
       QueueRef pq(new Queue(client_info_f, true));
 
-      Request req;
       ReqParams req_params(1,1);
 
       // make sure all times are well before now
       auto now = dmc::get_time();
 
-      pq->add_request_time(req, client1, req_params, now + 100);
+      pq->add_request_time(Request{}, client1, req_params, now + 100);
       Queue::PullReq pr = pq->pull_request(now);
 
       EXPECT_EQ(Queue::NextReqType::returning, pr.type);
@@ -808,13 +808,12 @@ namespace crimson {
 
       QueueRef pq(new Queue(client_info_f, true));
 
-      Request req;
       ReqParams req_params(1,1);
 
       // make sure all times are well before now
       auto now = dmc::get_time();
 
-      pq->add_request_time(req, client1, req_params, now + 100);
+      pq->add_request_time(Request{}, client1, req_params, now + 100);
       Queue::PullReq pr = pq->pull_request(now);
 
       EXPECT_EQ(Queue::NextReqType::returning, pr.type);