Merge lp:~marcustomlinson/unity-scopes-api/debug_timeout_config_params into lp:unity-scopes-api/devel

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 619
Merged at revision: 605
Proposed branch: lp:~marcustomlinson/unity-scopes-api/debug_timeout_config_params
Merge into: lp:unity-scopes-api/devel
Prerequisite: lp:~marcustomlinson/unity-scopes-api/fix_debug_mode_locate_timeout
Diff against target: 465 lines (+119/-39)
14 files modified
CMakeLists.txt (+1/-1)
CONFIGFILES (+34/-16)
RELEASE_NOTES.md (+9/-0)
debian/changelog (+7/-0)
debian/libunity-scopes3.symbols (+1/-0)
include/unity/scopes/internal/DfltConfig.h.in (+9/-7)
include/unity/scopes/internal/RegistryConfig.h (+2/-0)
include/unity/scopes/internal/zmq_middleware/ZmqConfig.h (+2/-0)
include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h (+2/-0)
scoperegistry/scoperegistry.cpp (+15/-11)
src/scopes/internal/RegistryConfig.cpp (+13/-1)
src/scopes/internal/zmq_middleware/ZmqConfig.cpp (+13/-0)
src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp (+6/-0)
src/scopes/internal/zmq_middleware/ZmqScope.cpp (+5/-3)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/debug_timeout_config_params
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Paweł Stołowski (community) Approve
Review via email: mp+263215@code.launchpad.net

Commit message

Hardcoded debug process and locate timeouts replaced with config parameters.

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

21 -- Process.Timeout

By the way, this Process.Timeout section of CONFIGFILES was incorrectly under Runtime.ini. So it was moved to its correct position under Registry.ini.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

62 + This parameter determines how the registry will wait for a scope

Should say "how long"?

review: Needs Information
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> 62 + This parameter determines how the registry will wait for a scope
>
> Should say "how long"?

Yep, thats a mistake. Fixed.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

335 + debug_process_timeout_ = get_optional_int(registry_config_group, debug_process_timeout_key, DFLT_DEBUG_PROCESS_TIMEOUT);
336 + if (process_timeout_ < 10 || process_timeout_ > 120000)

381 + debug_locate_timeout_ = get_optional_int(zmq_config_group, debug_locate_timeout_key, DFLT_ZMQ_DEBUG_LOCATE_TIMEOUT);
382 + if (locate_timeout_ < 10 || locate_timeout_ > 120000)
383 + {

Seems like the conditionals check wrong variables, i.e. not the ones read above? Or is it intended?

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> 335 + debug_process_timeout_ = get_optional_int(registry_config_group,
> debug_process_timeout_key, DFLT_DEBUG_PROCESS_TIMEOUT);
> 336 + if (process_timeout_ < 10 || process_timeout_ > 120000)
>
>
> 381 + debug_locate_timeout_ = get_optional_int(zmq_config_group,
> debug_locate_timeout_key, DFLT_ZMQ_DEBUG_LOCATE_TIMEOUT);
> 382 + if (locate_timeout_ < 10 || locate_timeout_ > 120000)
> 383 + {
>
> Seems like the conditionals check wrong variables, i.e. not the ones read
> above? Or is it intended?

OOPS! Totally not intended! Good catch! Fixed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Yeah, looks good now, thanks! Would be great to have tests for this config aspect, but since this area is lacking tests completely at the moment and this would require quite some work, let's address it separately.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-06-16 13:55:23 +0000
3+++ CMakeLists.txt 2015-06-29 15:09:40 +0000
4@@ -218,7 +218,7 @@
5 # API version
6 set(UNITY_SCOPES_MAJOR 0)
7 set(UNITY_SCOPES_MINOR 6)
8-set(UNITY_SCOPES_MICRO 19)
9+set(UNITY_SCOPES_MICRO 20)
10 set(UNITY_SCOPES_SOVERSION 3)
11
12 # Version for testing, with all symbols visible
13
14=== modified file 'CONFIGFILES'
15--- CONFIGFILES 2015-06-11 11:11:42 +0000
16+++ CONFIGFILES 2015-06-29 15:09:40 +0000
17@@ -76,22 +76,6 @@
18
19 The default value is 10 seconds.
20
21-- Process.Timeout
22-
23- This parameter determines how the registry will wait for a scope
24- to start and stop. The registry waits for at most Process.Timeout
25- milliseconds before it concludes that a scope failed to initialize
26- or terminate correctly. If a scope does not respond
27- within the allotted time, it is killed with SIGKILL.
28-
29- Only values in the range 10 to 15000 milliseconds are accepted.
30-
31- The default value is 4000 milliseconds.
32-
33- Note that this value must be less than Locate.Timeout in the [<Middleware>]
34- config group, otherwise the middleware can prematurely conclude that
35- a locate() request failed to start a scope.
36-
37 - CacheDir
38
39 The parent directory under which a scope can write scope-specific data files
40@@ -242,6 +226,15 @@
41
42 The default value is 5000 milliseconds.
43
44+- Debug.Locate.Timeout
45+
46+ This parameter overrides the value of Locate.Timeout above when DebugMode is enabled on
47+ a target scope. (See DebugMode in <scope_id>.ini for more details)
48+
49+ Only values in the range 10 to 120000 milliseconds are accepted.
50+
51+ The default value is 30000 milliseconds.
52+
53 - Registry.Timeout
54
55 The timeout to be used when invoking a twoway operation on the registry other
56@@ -306,6 +299,31 @@
57
58 The default value is "$HOME/.local/share/unity-scopes".
59
60+- Process.Timeout
61+
62+ This parameter determines how long the registry will wait for a scope
63+ to start and stop. The registry waits for at most Process.Timeout
64+ milliseconds before it concludes that a scope failed to initialize
65+ or terminate correctly. If a scope does not respond
66+ within the allotted time, it is killed with SIGKILL.
67+
68+ Only values in the range 10 to 15000 milliseconds are accepted.
69+
70+ The default value is 4000 milliseconds.
71+
72+ Note that this value must be less than Locate.Timeout in the [<Middleware>]
73+ config group, otherwise the middleware can prematurely conclude that
74+ a locate() request failed to start a scope.
75+
76+- Debug.Process.Timeout
77+
78+ This parameter overrides the value of Process.Timeout above when DebugMode is enabled on
79+ a target scope. (See DebugMode in <scope_id>.ini for more details)
80+
81+ Only values in the range 10 to 120000 milliseconds are accepted.
82+
83+ The default value is 30000 milliseconds.
84+
85
86 Smartscopes.ini
87 --------------
88
89=== modified file 'RELEASE_NOTES.md'
90--- RELEASE_NOTES.md 2015-06-01 10:15:48 +0000
91+++ RELEASE_NOTES.md 2015-06-29 15:09:40 +0000
92@@ -1,6 +1,15 @@
93 Release notes
94 =============
95
96+Changes in version 0.6.20
97+=========================
98+ - Added Debug.Process.Timeout configuration parameter to Registry.ini
99+ - Added Debug.Locate.Timeout configuration parameter to Zmq.ini
100+
101+Changes in version 0.6.19
102+=========================
103+ - Support UNITY_SCOPES_CONFIG_DIR environment variable.
104+
105 Changes in version 0.6.18
106 =========================
107 - Allow child_scopes() and set_child_scopes() methods more time to
108
109=== modified file 'debian/changelog'
110--- debian/changelog 2015-06-17 16:30:27 +0000
111+++ debian/changelog 2015-06-29 15:09:40 +0000
112@@ -1,3 +1,10 @@
113+unity-scopes-api (0.6.20-0ubuntu1) UNRELEASED; urgency=medium
114+
115+ * Added Debug.Process.Timeout configuration parameter to Registry.ini
116+ * Added Debug.Locate.Timeout configuration parameter to Zmq.ini
117+
118+ -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Mon, 29 Jun 2015 07:56:37 +0200
119+
120 unity-scopes-api (0.6.19+15.10.20150617.2-0ubuntu1) wily; urgency=medium
121
122 [ Pawel Stolowski ]
123
124=== modified file 'debian/libunity-scopes3.symbols'
125--- debian/libunity-scopes3.symbols 2015-06-09 12:21:21 +0000
126+++ debian/libunity-scopes3.symbols 2015-06-29 15:09:40 +0000
127@@ -395,6 +395,7 @@
128 (c++)"unity::scopes::internal::MiddlewareFactory::MiddlewareFactory(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1
129 (c++)"unity::scopes::internal::MiddlewareFactory::to_kind(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.4.0+14.04.20140312.1
130 (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428
131+ (c++)"unity::scopes::internal::RegistryConfig::debug_process_timeout() const@Base" 0replaceme
132 (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1
133 (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1
134 (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1
135
136=== modified file 'include/unity/scopes/internal/DfltConfig.h.in'
137--- include/unity/scopes/internal/DfltConfig.h.in 2015-05-06 05:45:30 +0000
138+++ include/unity/scopes/internal/DfltConfig.h.in 2015-06-29 15:09:40 +0000
139@@ -46,13 +46,15 @@
140
141 static constexpr char const* DFLT_SS_SCOPE_IDENTITY = "SmartScope";
142
143-static constexpr int DFLT_REAP_EXPIRY = 45; // seconds
144-static constexpr int DFLT_REAP_INTERVAL = 10; // seconds
145-static constexpr int DFLT_PROCESS_TIMEOUT = 4000; // milliseconds
146-static constexpr int DFLT_ZMQ_TWOWAY_TIMEOUT = 500; // milliseconds
147-static constexpr int DFLT_ZMQ_LOCATE_TIMEOUT = 5000; // milliseconds
148-static constexpr int DFLT_ZMQ_REGISTRY_TIMEOUT = 5000; // milliseconds
149-static constexpr int DFLT_ZMQ_CHILDSCOPES_TIMEOUT = 2000; // milliseconds
150+static constexpr int DFLT_REAP_EXPIRY = 45; // seconds
151+static constexpr int DFLT_REAP_INTERVAL = 10; // seconds
152+static constexpr int DFLT_PROCESS_TIMEOUT = 4000; // milliseconds
153+static constexpr int DFLT_DEBUG_PROCESS_TIMEOUT = 30000; // milliseconds
154+static constexpr int DFLT_ZMQ_TWOWAY_TIMEOUT = 500; // milliseconds
155+static constexpr int DFLT_ZMQ_LOCATE_TIMEOUT = 5000; // milliseconds
156+static constexpr int DFLT_ZMQ_DEBUG_LOCATE_TIMEOUT = 30000; // milliseconds
157+static constexpr int DFLT_ZMQ_REGISTRY_TIMEOUT = 5000; // milliseconds
158+static constexpr int DFLT_ZMQ_CHILDSCOPES_TIMEOUT = 2000; // milliseconds
159
160 static constexpr char const* DFLT_HOME_CACHE_SUBDIR = ".local/share/unity-scopes";
161 static constexpr char const* DFLT_HOME_APP_SUBDIR = ".local/share";
162
163=== modified file 'include/unity/scopes/internal/RegistryConfig.h'
164--- include/unity/scopes/internal/RegistryConfig.h 2014-11-03 05:31:30 +0000
165+++ include/unity/scopes/internal/RegistryConfig.h 2015-06-29 15:09:40 +0000
166@@ -43,6 +43,7 @@
167 std::string click_installdir() const; // Directory for Click scope config files
168 std::string scoperunner_path() const; // Path to scoperunner binary
169 int process_timeout() const; // Milliseconds to wait before scope is considereed non-responsive.
170+ int debug_process_timeout() const; // Milliseconds to wait before scope is considereed non-responsive in debug mode.
171
172 private:
173 std::string identity_;
174@@ -53,6 +54,7 @@
175 std::string click_installdir_;
176 std::string scoperunner_path_;
177 int process_timeout_; // Milliseconds
178+ int debug_process_timeout_; // Milliseconds
179 };
180
181 } // namespace internal
182
183=== modified file 'include/unity/scopes/internal/zmq_middleware/ZmqConfig.h'
184--- include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2015-05-06 05:45:30 +0000
185+++ include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2015-06-29 15:09:40 +0000
186@@ -38,6 +38,7 @@
187 std::string endpoint_dir() const;
188 int twoway_timeout() const;
189 int locate_timeout() const;
190+ int debug_locate_timeout() const;
191 int registry_timeout() const;
192 int child_scopes_timeout() const;
193 std::string registry_endpoint_dir() const;
194@@ -47,6 +48,7 @@
195 std::string endpoint_dir_;
196 int twoway_timeout_;
197 int locate_timeout_;
198+ int debug_locate_timeout_;
199 int registry_timeout_;
200 int child_scopes_timeout_;
201 std::string registry_endpoint_dir_;
202
203=== modified file 'include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h'
204--- include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2015-05-06 05:45:30 +0000
205+++ include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2015-06-29 15:09:40 +0000
206@@ -93,6 +93,7 @@
207 ThreadPool* oneway_pool();
208 ThreadPool* twoway_pool();
209 int64_t locate_timeout() const noexcept;
210+ int64_t debug_locate_timeout() const noexcept;
211 int64_t registry_timeout() const noexcept;
212 int64_t child_scopes_timeout() const noexcept;
213
214@@ -138,6 +139,7 @@
215
216 int64_t twoway_timeout_; // Default timeout for twoway invocations
217 int64_t locate_timeout_; // Timeout for registry locate()
218+ int64_t debug_locate_timeout_; // Timeout for registry locate() in debug mode
219 int64_t registry_timeout_; // Timeout for registry operations other than locate()
220 int64_t child_scopes_timeout_; // Timeout for child_scopes() and set_child_scopes() methods
221
222
223=== modified file 'scoperegistry/scoperegistry.cpp'
224--- scoperegistry/scoperegistry.cpp 2015-06-26 09:00:04 +0000
225+++ scoperegistry/scoperegistry.cpp 2015-06-29 15:09:40 +0000
226@@ -293,7 +293,8 @@
227 string const& scoperunner_path,
228 string const& config_file,
229 bool click,
230- int timeout_ms)
231+ int timeout_ms,
232+ int debug_timeout_ms)
233 {
234 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(mw.get()));
235 string scope_config(scope.second);
236@@ -423,10 +424,10 @@
237 scope_dir.filename().native();
238 }
239
240- // Check if this scope has requested debug mode, if so, set the process timeout to 30s
241+ // Check if this scope has requested debug mode, if so, set the process timeout to debug_process_timeout
242 if (sc.debug_mode())
243 {
244- exec_data.timeout_ms = 30000;
245+ exec_data.timeout_ms = debug_timeout_ms;
246 }
247 else
248 {
249@@ -479,13 +480,14 @@
250 string const& scoperunner_path,
251 string const& config_file,
252 bool click,
253- int timeout_ms)
254+ int timeout_ms,
255+ int debug_timeout_ms)
256 {
257 for (auto&& pair : all_scopes)
258 {
259 try
260 {
261- add_local_scope(registry, pair, mw, scoperunner_path, config_file, click, timeout_ms);
262+ add_local_scope(registry, pair, mw, scoperunner_path, config_file, click, timeout_ms, debug_timeout_ms);
263 }
264 catch (unity::Exception const& e)
265 {
266@@ -555,6 +557,7 @@
267 string click_installdir;
268 string scoperunner_path;
269 int process_timeout;
270+ int debug_process_timeout;
271 {
272 RegistryConfig c(identity, runtime->registry_configfile());
273 mw_kind = c.mw_kind();
274@@ -563,6 +566,7 @@
275 click_installdir = c.click_installdir();
276 scoperunner_path = c.scoperunner_path();
277 process_timeout = c.process_timeout();
278+ debug_process_timeout = c.debug_process_timeout();
279 } // Release memory for config parser
280
281 // Inform the signal thread that it should shutdown the runtime
282@@ -603,8 +607,8 @@
283 local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries
284 }
285
286- add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false, process_timeout);
287- add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true, process_timeout);
288+ add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false, process_timeout, debug_process_timeout);
289+ add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true, process_timeout, debug_process_timeout);
290 if (ss_reg_id.empty())
291 {
292 error("no remote registry configured, only local scopes will be available");
293@@ -615,12 +619,12 @@
294 }
295
296 // Configure watches for scope install directories
297- auto local_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout]
298+ auto local_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout, debug_process_timeout]
299 (pair<string, string> const& scope)
300 {
301 try
302 {
303- add_local_scope(registry, scope, middleware, scoperunner_path, config_file, false, process_timeout);
304+ add_local_scope(registry, scope, middleware, scoperunner_path, config_file, false, process_timeout, debug_process_timeout);
305 }
306 catch (unity::Exception const& e)
307 {
308@@ -631,12 +635,12 @@
309 local_scopes_watcher.add_install_dir(scope_installdir);
310 local_scopes_watcher.add_install_dir(oem_installdir);
311
312- auto click_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout]
313+ auto click_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout, debug_process_timeout]
314 (pair<string, string> const& scope)
315 {
316 try
317 {
318- add_local_scope(registry, scope, middleware, scoperunner_path, config_file, true, process_timeout);
319+ add_local_scope(registry, scope, middleware, scoperunner_path, config_file, true, process_timeout, debug_process_timeout);
320 }
321 catch (unity::Exception const& e)
322 {
323
324=== modified file 'src/scopes/internal/RegistryConfig.cpp'
325--- src/scopes/internal/RegistryConfig.cpp 2014-08-08 12:21:47 +0000
326+++ src/scopes/internal/RegistryConfig.cpp 2015-06-29 15:09:40 +0000
327@@ -45,6 +45,7 @@
328 const string click_installdir_key = "Click.InstallDir";
329 const string scoperunner_path_key = "Scoperunner.Path";
330 const string process_timeout_key = "Process.Timeout";
331+ const string debug_process_timeout_key = "Debug.Process.Timeout";
332 }
333
334 RegistryConfig::RegistryConfig(string const& identity, string const& configfile) :
335@@ -79,6 +80,11 @@
336 {
337 throw_ex("Illegal value (" + to_string(process_timeout_) + ") for " + process_timeout_key + ": value must be 10-15000 ms");
338 }
339+ debug_process_timeout_ = get_optional_int(registry_config_group, debug_process_timeout_key, DFLT_DEBUG_PROCESS_TIMEOUT);
340+ if (debug_process_timeout_ < 10 || debug_process_timeout_ > 120000)
341+ {
342+ throw_ex("Illegal value (" + to_string(debug_process_timeout_) + ") for " + debug_process_timeout_key + ": value must be 10-120000 ms");
343+ }
344
345 KnownEntries const known_entries = {
346 { registry_config_group,
347@@ -89,7 +95,8 @@
348 oem_installdir_key,
349 click_installdir_key,
350 scoperunner_path_key,
351- process_timeout_key
352+ process_timeout_key,
353+ debug_process_timeout_key
354 }
355 }
356 };
357@@ -140,6 +147,11 @@
358 return process_timeout_;
359 }
360
361+int RegistryConfig::debug_process_timeout() const
362+{
363+ return debug_process_timeout_;
364+}
365+
366 } // namespace internal
367
368 } // namespace scopes
369
370=== modified file 'src/scopes/internal/zmq_middleware/ZmqConfig.cpp'
371--- src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2015-05-06 05:45:30 +0000
372+++ src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2015-06-29 15:09:40 +0000
373@@ -41,6 +41,7 @@
374 const string endpoint_dir_key = "EndpointDir";
375 const string twoway_timeout_key = "Default.Twoway.Timeout";
376 const string locate_timeout_key = "Locate.Timeout";
377+ const string debug_locate_timeout_key = "Debug.Locate.Timeout";
378 const string registry_timeout_key = "Registry.Timeout";
379 const string child_scopes_timeout_key = "ChildScopes.Timeout";
380 const string registry_endpoint_dir_key = "Registry.EndpointDir";
381@@ -91,6 +92,12 @@
382 throw_ex("Illegal value (" + to_string(locate_timeout_) + ") for " + locate_timeout_key + ": value must be 10-15000");
383 }
384
385+ debug_locate_timeout_ = get_optional_int(zmq_config_group, debug_locate_timeout_key, DFLT_ZMQ_DEBUG_LOCATE_TIMEOUT);
386+ if (debug_locate_timeout_ < 10 || debug_locate_timeout_ > 120000)
387+ {
388+ throw_ex("Illegal value (" + to_string(debug_locate_timeout_) + ") for " + debug_locate_timeout_key + ": value must be 10-120000");
389+ }
390+
391 child_scopes_timeout_ = get_optional_int(zmq_config_group, child_scopes_timeout_key, DFLT_ZMQ_CHILDSCOPES_TIMEOUT);
392 if (child_scopes_timeout_ < 10 || child_scopes_timeout_ > 15000)
393 {
394@@ -106,6 +113,7 @@
395 endpoint_dir_key,
396 twoway_timeout_key,
397 locate_timeout_key,
398+ debug_locate_timeout_key,
399 registry_timeout_key,
400 child_scopes_timeout_key,
401 registry_endpoint_dir_key,
402@@ -135,6 +143,11 @@
403 return locate_timeout_;
404 }
405
406+int ZmqConfig::debug_locate_timeout() const
407+{
408+ return debug_locate_timeout_;
409+}
410+
411 int ZmqConfig::registry_timeout() const
412 {
413 return registry_timeout_;
414
415=== modified file 'src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp'
416--- src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2015-05-06 05:45:30 +0000
417+++ src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2015-06-29 15:09:40 +0000
418@@ -106,6 +106,7 @@
419
420 twoway_timeout_ = config.twoway_timeout();
421 locate_timeout_ = config.locate_timeout();
422+ debug_locate_timeout_ = config.debug_locate_timeout();
423 registry_timeout_ = config.registry_timeout();
424 child_scopes_timeout_ = config.child_scopes_timeout();
425 public_endpoint_dir_ = config.endpoint_dir();
426@@ -810,6 +811,11 @@
427 return locate_timeout_;
428 }
429
430+int64_t ZmqMiddleware::debug_locate_timeout() const noexcept
431+{
432+ return debug_locate_timeout_;
433+}
434+
435 int64_t ZmqMiddleware::registry_timeout() const noexcept
436 {
437 return registry_timeout_;
438
439=== modified file 'src/scopes/internal/zmq_middleware/ZmqScope.cpp'
440--- src/scopes/internal/zmq_middleware/ZmqScope.cpp 2015-06-26 09:00:04 +0000
441+++ src/scopes/internal/zmq_middleware/ZmqScope.cpp 2015-06-29 15:09:40 +0000
442@@ -325,7 +325,8 @@
443 capnp::MallocMessageBuilder request_builder;
444 make_request_(request_builder, "debug_mode");
445
446- auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder, -1, 30000); });
447+ int64_t timeout = mw_base()->debug_locate_timeout();
448+ auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder, -1, timeout); });
449 auto out_params = future.get();
450 auto response = out_params.reader->getRoot<capnproto::Response>();
451 throw_if_runtime_exception(response);
452@@ -345,10 +346,11 @@
453 ZmqObjectProxy::TwowayOutParams ZmqScope::invoke_scope_(capnp::MessageBuilder& in_params, int64_t timeout)
454 {
455 // Check if this scope has requested debug mode, if so, disable two-way timeout and set
456- // locate timeout to 30s.
457+ // locate timeout to debug_locate_timeout.
458 if (debug_mode())
459 {
460- return this->invoke_twoway_(in_params, -1, 30000);
461+ int64_t timeout = mw_base()->debug_locate_timeout();
462+ return this->invoke_twoway_(in_params, -1, timeout);
463 }
464 return this->invoke_twoway_(in_params, timeout);
465 }

Subscribers

People subscribed via source and target branches

to all changes: