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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-06-16 13:55:23 +0000
+++ CMakeLists.txt 2015-06-29 15:09:40 +0000
@@ -218,7 +218,7 @@
218# API version218# API version
219set(UNITY_SCOPES_MAJOR 0)219set(UNITY_SCOPES_MAJOR 0)
220set(UNITY_SCOPES_MINOR 6)220set(UNITY_SCOPES_MINOR 6)
221set(UNITY_SCOPES_MICRO 19)221set(UNITY_SCOPES_MICRO 20)
222set(UNITY_SCOPES_SOVERSION 3)222set(UNITY_SCOPES_SOVERSION 3)
223223
224# Version for testing, with all symbols visible224# Version for testing, with all symbols visible
225225
=== modified file 'CONFIGFILES'
--- CONFIGFILES 2015-06-11 11:11:42 +0000
+++ CONFIGFILES 2015-06-29 15:09:40 +0000
@@ -76,22 +76,6 @@
7676
77 The default value is 10 seconds.77 The default value is 10 seconds.
7878
79- Process.Timeout
80
81 This parameter determines how the registry will wait for a scope
82 to start and stop. The registry waits for at most Process.Timeout
83 milliseconds before it concludes that a scope failed to initialize
84 or terminate correctly. If a scope does not respond
85 within the allotted time, it is killed with SIGKILL.
86
87 Only values in the range 10 to 15000 milliseconds are accepted.
88
89 The default value is 4000 milliseconds.
90
91 Note that this value must be less than Locate.Timeout in the [<Middleware>]
92 config group, otherwise the middleware can prematurely conclude that
93 a locate() request failed to start a scope.
94
95- CacheDir79- CacheDir
9680
97 The parent directory under which a scope can write scope-specific data files81 The parent directory under which a scope can write scope-specific data files
@@ -242,6 +226,15 @@
242226
243 The default value is 5000 milliseconds.227 The default value is 5000 milliseconds.
244228
229- Debug.Locate.Timeout
230
231 This parameter overrides the value of Locate.Timeout above when DebugMode is enabled on
232 a target scope. (See DebugMode in <scope_id>.ini for more details)
233
234 Only values in the range 10 to 120000 milliseconds are accepted.
235
236 The default value is 30000 milliseconds.
237
245- Registry.Timeout238- Registry.Timeout
246239
247 The timeout to be used when invoking a twoway operation on the registry other240 The timeout to be used when invoking a twoway operation on the registry other
@@ -306,6 +299,31 @@
306299
307 The default value is "$HOME/.local/share/unity-scopes".300 The default value is "$HOME/.local/share/unity-scopes".
308301
302- Process.Timeout
303
304 This parameter determines how long the registry will wait for a scope
305 to start and stop. The registry waits for at most Process.Timeout
306 milliseconds before it concludes that a scope failed to initialize
307 or terminate correctly. If a scope does not respond
308 within the allotted time, it is killed with SIGKILL.
309
310 Only values in the range 10 to 15000 milliseconds are accepted.
311
312 The default value is 4000 milliseconds.
313
314 Note that this value must be less than Locate.Timeout in the [<Middleware>]
315 config group, otherwise the middleware can prematurely conclude that
316 a locate() request failed to start a scope.
317
318- Debug.Process.Timeout
319
320 This parameter overrides the value of Process.Timeout above when DebugMode is enabled on
321 a target scope. (See DebugMode in <scope_id>.ini for more details)
322
323 Only values in the range 10 to 120000 milliseconds are accepted.
324
325 The default value is 30000 milliseconds.
326
309327
310Smartscopes.ini328Smartscopes.ini
311--------------329--------------
312330
=== modified file 'RELEASE_NOTES.md'
--- RELEASE_NOTES.md 2015-06-01 10:15:48 +0000
+++ RELEASE_NOTES.md 2015-06-29 15:09:40 +0000
@@ -1,6 +1,15 @@
1Release notes1Release notes
2=============2=============
33
4Changes in version 0.6.20
5=========================
6 - Added Debug.Process.Timeout configuration parameter to Registry.ini
7 - Added Debug.Locate.Timeout configuration parameter to Zmq.ini
8
9Changes in version 0.6.19
10=========================
11 - Support UNITY_SCOPES_CONFIG_DIR environment variable.
12
4Changes in version 0.6.1813Changes in version 0.6.18
5=========================14=========================
6 - Allow child_scopes() and set_child_scopes() methods more time to15 - Allow child_scopes() and set_child_scopes() methods more time to
716
=== modified file 'debian/changelog'
--- debian/changelog 2015-06-17 16:30:27 +0000
+++ debian/changelog 2015-06-29 15:09:40 +0000
@@ -1,3 +1,10 @@
1unity-scopes-api (0.6.20-0ubuntu1) UNRELEASED; urgency=medium
2
3 * Added Debug.Process.Timeout configuration parameter to Registry.ini
4 * Added Debug.Locate.Timeout configuration parameter to Zmq.ini
5
6 -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Mon, 29 Jun 2015 07:56:37 +0200
7
1unity-scopes-api (0.6.19+15.10.20150617.2-0ubuntu1) wily; urgency=medium8unity-scopes-api (0.6.19+15.10.20150617.2-0ubuntu1) wily; urgency=medium
29
3 [ Pawel Stolowski ]10 [ Pawel Stolowski ]
411
=== modified file 'debian/libunity-scopes3.symbols'
--- debian/libunity-scopes3.symbols 2015-06-09 12:21:21 +0000
+++ debian/libunity-scopes3.symbols 2015-06-29 15:09:40 +0000
@@ -395,6 +395,7 @@
395 (c++)"unity::scopes::internal::MiddlewareFactory::MiddlewareFactory(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1395 (c++)"unity::scopes::internal::MiddlewareFactory::MiddlewareFactory(unity::scopes::internal::RuntimeImpl*)@Base" 0.4.0+14.04.20140312.1
396 (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.1396 (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
397 (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428397 (c++)"unity::scopes::internal::RegistryConfig::click_installdir() const@Base" 0.4.3+14.10.20140428
398 (c++)"unity::scopes::internal::RegistryConfig::debug_process_timeout() const@Base" 0replaceme
398 (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1399 (c++)"unity::scopes::internal::RegistryConfig::identity() const@Base" 0.4.0+14.04.20140312.1
399 (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1400 (c++)"unity::scopes::internal::RegistryConfig::mw_configfile() const@Base" 0.4.0+14.04.20140312.1
400 (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1401 (c++)"unity::scopes::internal::RegistryConfig::mw_kind() const@Base" 0.4.0+14.04.20140312.1
401402
=== modified file 'include/unity/scopes/internal/DfltConfig.h.in'
--- include/unity/scopes/internal/DfltConfig.h.in 2015-05-06 05:45:30 +0000
+++ include/unity/scopes/internal/DfltConfig.h.in 2015-06-29 15:09:40 +0000
@@ -46,13 +46,15 @@
4646
47static constexpr char const* DFLT_SS_SCOPE_IDENTITY = "SmartScope";47static constexpr char const* DFLT_SS_SCOPE_IDENTITY = "SmartScope";
4848
49static constexpr int DFLT_REAP_EXPIRY = 45; // seconds49static constexpr int DFLT_REAP_EXPIRY = 45; // seconds
50static constexpr int DFLT_REAP_INTERVAL = 10; // seconds50static constexpr int DFLT_REAP_INTERVAL = 10; // seconds
51static constexpr int DFLT_PROCESS_TIMEOUT = 4000; // milliseconds51static constexpr int DFLT_PROCESS_TIMEOUT = 4000; // milliseconds
52static constexpr int DFLT_ZMQ_TWOWAY_TIMEOUT = 500; // milliseconds52static constexpr int DFLT_DEBUG_PROCESS_TIMEOUT = 30000; // milliseconds
53static constexpr int DFLT_ZMQ_LOCATE_TIMEOUT = 5000; // milliseconds53static constexpr int DFLT_ZMQ_TWOWAY_TIMEOUT = 500; // milliseconds
54static constexpr int DFLT_ZMQ_REGISTRY_TIMEOUT = 5000; // milliseconds54static constexpr int DFLT_ZMQ_LOCATE_TIMEOUT = 5000; // milliseconds
55static constexpr int DFLT_ZMQ_CHILDSCOPES_TIMEOUT = 2000; // milliseconds55static constexpr int DFLT_ZMQ_DEBUG_LOCATE_TIMEOUT = 30000; // milliseconds
56static constexpr int DFLT_ZMQ_REGISTRY_TIMEOUT = 5000; // milliseconds
57static constexpr int DFLT_ZMQ_CHILDSCOPES_TIMEOUT = 2000; // milliseconds
5658
57static constexpr char const* DFLT_HOME_CACHE_SUBDIR = ".local/share/unity-scopes";59static constexpr char const* DFLT_HOME_CACHE_SUBDIR = ".local/share/unity-scopes";
58static constexpr char const* DFLT_HOME_APP_SUBDIR = ".local/share";60static constexpr char const* DFLT_HOME_APP_SUBDIR = ".local/share";
5961
=== modified file 'include/unity/scopes/internal/RegistryConfig.h'
--- include/unity/scopes/internal/RegistryConfig.h 2014-11-03 05:31:30 +0000
+++ include/unity/scopes/internal/RegistryConfig.h 2015-06-29 15:09:40 +0000
@@ -43,6 +43,7 @@
43 std::string click_installdir() const; // Directory for Click scope config files43 std::string click_installdir() const; // Directory for Click scope config files
44 std::string scoperunner_path() const; // Path to scoperunner binary44 std::string scoperunner_path() const; // Path to scoperunner binary
45 int process_timeout() const; // Milliseconds to wait before scope is considereed non-responsive.45 int process_timeout() const; // Milliseconds to wait before scope is considereed non-responsive.
46 int debug_process_timeout() const; // Milliseconds to wait before scope is considereed non-responsive in debug mode.
4647
47private:48private:
48 std::string identity_;49 std::string identity_;
@@ -53,6 +54,7 @@
53 std::string click_installdir_;54 std::string click_installdir_;
54 std::string scoperunner_path_;55 std::string scoperunner_path_;
55 int process_timeout_; // Milliseconds56 int process_timeout_; // Milliseconds
57 int debug_process_timeout_; // Milliseconds
56};58};
5759
58} // namespace internal60} // namespace internal
5961
=== modified file 'include/unity/scopes/internal/zmq_middleware/ZmqConfig.h'
--- include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2015-05-06 05:45:30 +0000
+++ include/unity/scopes/internal/zmq_middleware/ZmqConfig.h 2015-06-29 15:09:40 +0000
@@ -38,6 +38,7 @@
38 std::string endpoint_dir() const;38 std::string endpoint_dir() const;
39 int twoway_timeout() const;39 int twoway_timeout() const;
40 int locate_timeout() const;40 int locate_timeout() const;
41 int debug_locate_timeout() const;
41 int registry_timeout() const;42 int registry_timeout() const;
42 int child_scopes_timeout() const;43 int child_scopes_timeout() const;
43 std::string registry_endpoint_dir() const;44 std::string registry_endpoint_dir() const;
@@ -47,6 +48,7 @@
47 std::string endpoint_dir_;48 std::string endpoint_dir_;
48 int twoway_timeout_;49 int twoway_timeout_;
49 int locate_timeout_;50 int locate_timeout_;
51 int debug_locate_timeout_;
50 int registry_timeout_;52 int registry_timeout_;
51 int child_scopes_timeout_;53 int child_scopes_timeout_;
52 std::string registry_endpoint_dir_;54 std::string registry_endpoint_dir_;
5355
=== modified file 'include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h'
--- include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2015-05-06 05:45:30 +0000
+++ include/unity/scopes/internal/zmq_middleware/ZmqMiddleware.h 2015-06-29 15:09:40 +0000
@@ -93,6 +93,7 @@
93 ThreadPool* oneway_pool();93 ThreadPool* oneway_pool();
94 ThreadPool* twoway_pool();94 ThreadPool* twoway_pool();
95 int64_t locate_timeout() const noexcept;95 int64_t locate_timeout() const noexcept;
96 int64_t debug_locate_timeout() const noexcept;
96 int64_t registry_timeout() const noexcept;97 int64_t registry_timeout() const noexcept;
97 int64_t child_scopes_timeout() const noexcept;98 int64_t child_scopes_timeout() const noexcept;
9899
@@ -138,6 +139,7 @@
138139
139 int64_t twoway_timeout_; // Default timeout for twoway invocations140 int64_t twoway_timeout_; // Default timeout for twoway invocations
140 int64_t locate_timeout_; // Timeout for registry locate()141 int64_t locate_timeout_; // Timeout for registry locate()
142 int64_t debug_locate_timeout_; // Timeout for registry locate() in debug mode
141 int64_t registry_timeout_; // Timeout for registry operations other than locate()143 int64_t registry_timeout_; // Timeout for registry operations other than locate()
142 int64_t child_scopes_timeout_; // Timeout for child_scopes() and set_child_scopes() methods144 int64_t child_scopes_timeout_; // Timeout for child_scopes() and set_child_scopes() methods
143145
144146
=== modified file 'scoperegistry/scoperegistry.cpp'
--- scoperegistry/scoperegistry.cpp 2015-06-26 09:00:04 +0000
+++ scoperegistry/scoperegistry.cpp 2015-06-29 15:09:40 +0000
@@ -293,7 +293,8 @@
293 string const& scoperunner_path,293 string const& scoperunner_path,
294 string const& config_file,294 string const& config_file,
295 bool click,295 bool click,
296 int timeout_ms)296 int timeout_ms,
297 int debug_timeout_ms)
297{298{
298 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(mw.get()));299 unique_ptr<ScopeMetadataImpl> mi(new ScopeMetadataImpl(mw.get()));
299 string scope_config(scope.second);300 string scope_config(scope.second);
@@ -423,10 +424,10 @@
423 scope_dir.filename().native();424 scope_dir.filename().native();
424 }425 }
425426
426 // Check if this scope has requested debug mode, if so, set the process timeout to 30s427 // Check if this scope has requested debug mode, if so, set the process timeout to debug_process_timeout
427 if (sc.debug_mode())428 if (sc.debug_mode())
428 {429 {
429 exec_data.timeout_ms = 30000;430 exec_data.timeout_ms = debug_timeout_ms;
430 }431 }
431 else432 else
432 {433 {
@@ -479,13 +480,14 @@
479 string const& scoperunner_path,480 string const& scoperunner_path,
480 string const& config_file,481 string const& config_file,
481 bool click,482 bool click,
482 int timeout_ms)483 int timeout_ms,
484 int debug_timeout_ms)
483{485{
484 for (auto&& pair : all_scopes)486 for (auto&& pair : all_scopes)
485 {487 {
486 try488 try
487 {489 {
488 add_local_scope(registry, pair, mw, scoperunner_path, config_file, click, timeout_ms);490 add_local_scope(registry, pair, mw, scoperunner_path, config_file, click, timeout_ms, debug_timeout_ms);
489 }491 }
490 catch (unity::Exception const& e)492 catch (unity::Exception const& e)
491 {493 {
@@ -555,6 +557,7 @@
555 string click_installdir;557 string click_installdir;
556 string scoperunner_path;558 string scoperunner_path;
557 int process_timeout;559 int process_timeout;
560 int debug_process_timeout;
558 {561 {
559 RegistryConfig c(identity, runtime->registry_configfile());562 RegistryConfig c(identity, runtime->registry_configfile());
560 mw_kind = c.mw_kind();563 mw_kind = c.mw_kind();
@@ -563,6 +566,7 @@
563 click_installdir = c.click_installdir();566 click_installdir = c.click_installdir();
564 scoperunner_path = c.scoperunner_path();567 scoperunner_path = c.scoperunner_path();
565 process_timeout = c.process_timeout();568 process_timeout = c.process_timeout();
569 debug_process_timeout = c.debug_process_timeout();
566 } // Release memory for config parser570 } // Release memory for config parser
567571
568 // Inform the signal thread that it should shutdown the runtime572 // Inform the signal thread that it should shutdown the runtime
@@ -603,8 +607,8 @@
603 local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries607 local_scopes[scope_id] = argv[i]; // operator[] overwrites pre-existing entries
604 }608 }
605609
606 add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false, process_timeout);610 add_local_scopes(registry, local_scopes, middleware, scoperunner_path, config_file, false, process_timeout, debug_process_timeout);
607 add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true, process_timeout);611 add_local_scopes(registry, click_scopes, middleware, scoperunner_path, config_file, true, process_timeout, debug_process_timeout);
608 if (ss_reg_id.empty())612 if (ss_reg_id.empty())
609 {613 {
610 error("no remote registry configured, only local scopes will be available");614 error("no remote registry configured, only local scopes will be available");
@@ -615,12 +619,12 @@
615 }619 }
616620
617 // Configure watches for scope install directories621 // Configure watches for scope install directories
618 auto local_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout]622 auto local_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout, debug_process_timeout]
619 (pair<string, string> const& scope)623 (pair<string, string> const& scope)
620 {624 {
621 try625 try
622 {626 {
623 add_local_scope(registry, scope, middleware, scoperunner_path, config_file, false, process_timeout);627 add_local_scope(registry, scope, middleware, scoperunner_path, config_file, false, process_timeout, debug_process_timeout);
624 }628 }
625 catch (unity::Exception const& e)629 catch (unity::Exception const& e)
626 {630 {
@@ -631,12 +635,12 @@
631 local_scopes_watcher.add_install_dir(scope_installdir);635 local_scopes_watcher.add_install_dir(scope_installdir);
632 local_scopes_watcher.add_install_dir(oem_installdir);636 local_scopes_watcher.add_install_dir(oem_installdir);
633637
634 auto click_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout]638 auto click_watch_lambda = [registry, &middleware, &scoperunner_path, &config_file, process_timeout, debug_process_timeout]
635 (pair<string, string> const& scope)639 (pair<string, string> const& scope)
636 {640 {
637 try641 try
638 {642 {
639 add_local_scope(registry, scope, middleware, scoperunner_path, config_file, true, process_timeout);643 add_local_scope(registry, scope, middleware, scoperunner_path, config_file, true, process_timeout, debug_process_timeout);
640 }644 }
641 catch (unity::Exception const& e)645 catch (unity::Exception const& e)
642 {646 {
643647
=== modified file 'src/scopes/internal/RegistryConfig.cpp'
--- src/scopes/internal/RegistryConfig.cpp 2014-08-08 12:21:47 +0000
+++ src/scopes/internal/RegistryConfig.cpp 2015-06-29 15:09:40 +0000
@@ -45,6 +45,7 @@
45 const string click_installdir_key = "Click.InstallDir";45 const string click_installdir_key = "Click.InstallDir";
46 const string scoperunner_path_key = "Scoperunner.Path";46 const string scoperunner_path_key = "Scoperunner.Path";
47 const string process_timeout_key = "Process.Timeout";47 const string process_timeout_key = "Process.Timeout";
48 const string debug_process_timeout_key = "Debug.Process.Timeout";
48}49}
4950
50RegistryConfig::RegistryConfig(string const& identity, string const& configfile) :51RegistryConfig::RegistryConfig(string const& identity, string const& configfile) :
@@ -79,6 +80,11 @@
79 {80 {
80 throw_ex("Illegal value (" + to_string(process_timeout_) + ") for " + process_timeout_key + ": value must be 10-15000 ms");81 throw_ex("Illegal value (" + to_string(process_timeout_) + ") for " + process_timeout_key + ": value must be 10-15000 ms");
81 }82 }
83 debug_process_timeout_ = get_optional_int(registry_config_group, debug_process_timeout_key, DFLT_DEBUG_PROCESS_TIMEOUT);
84 if (debug_process_timeout_ < 10 || debug_process_timeout_ > 120000)
85 {
86 throw_ex("Illegal value (" + to_string(debug_process_timeout_) + ") for " + debug_process_timeout_key + ": value must be 10-120000 ms");
87 }
8288
83 KnownEntries const known_entries = {89 KnownEntries const known_entries = {
84 { registry_config_group,90 { registry_config_group,
@@ -89,7 +95,8 @@
89 oem_installdir_key,95 oem_installdir_key,
90 click_installdir_key,96 click_installdir_key,
91 scoperunner_path_key,97 scoperunner_path_key,
92 process_timeout_key98 process_timeout_key,
99 debug_process_timeout_key
93 }100 }
94 }101 }
95 };102 };
@@ -140,6 +147,11 @@
140 return process_timeout_;147 return process_timeout_;
141}148}
142149
150int RegistryConfig::debug_process_timeout() const
151{
152 return debug_process_timeout_;
153}
154
143} // namespace internal155} // namespace internal
144156
145} // namespace scopes157} // namespace scopes
146158
=== modified file 'src/scopes/internal/zmq_middleware/ZmqConfig.cpp'
--- src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2015-05-06 05:45:30 +0000
+++ src/scopes/internal/zmq_middleware/ZmqConfig.cpp 2015-06-29 15:09:40 +0000
@@ -41,6 +41,7 @@
41 const string endpoint_dir_key = "EndpointDir";41 const string endpoint_dir_key = "EndpointDir";
42 const string twoway_timeout_key = "Default.Twoway.Timeout";42 const string twoway_timeout_key = "Default.Twoway.Timeout";
43 const string locate_timeout_key = "Locate.Timeout";43 const string locate_timeout_key = "Locate.Timeout";
44 const string debug_locate_timeout_key = "Debug.Locate.Timeout";
44 const string registry_timeout_key = "Registry.Timeout";45 const string registry_timeout_key = "Registry.Timeout";
45 const string child_scopes_timeout_key = "ChildScopes.Timeout";46 const string child_scopes_timeout_key = "ChildScopes.Timeout";
46 const string registry_endpoint_dir_key = "Registry.EndpointDir";47 const string registry_endpoint_dir_key = "Registry.EndpointDir";
@@ -91,6 +92,12 @@
91 throw_ex("Illegal value (" + to_string(locate_timeout_) + ") for " + locate_timeout_key + ": value must be 10-15000");92 throw_ex("Illegal value (" + to_string(locate_timeout_) + ") for " + locate_timeout_key + ": value must be 10-15000");
92 }93 }
9394
95 debug_locate_timeout_ = get_optional_int(zmq_config_group, debug_locate_timeout_key, DFLT_ZMQ_DEBUG_LOCATE_TIMEOUT);
96 if (debug_locate_timeout_ < 10 || debug_locate_timeout_ > 120000)
97 {
98 throw_ex("Illegal value (" + to_string(debug_locate_timeout_) + ") for " + debug_locate_timeout_key + ": value must be 10-120000");
99 }
100
94 child_scopes_timeout_ = get_optional_int(zmq_config_group, child_scopes_timeout_key, DFLT_ZMQ_CHILDSCOPES_TIMEOUT);101 child_scopes_timeout_ = get_optional_int(zmq_config_group, child_scopes_timeout_key, DFLT_ZMQ_CHILDSCOPES_TIMEOUT);
95 if (child_scopes_timeout_ < 10 || child_scopes_timeout_ > 15000)102 if (child_scopes_timeout_ < 10 || child_scopes_timeout_ > 15000)
96 {103 {
@@ -106,6 +113,7 @@
106 endpoint_dir_key,113 endpoint_dir_key,
107 twoway_timeout_key,114 twoway_timeout_key,
108 locate_timeout_key,115 locate_timeout_key,
116 debug_locate_timeout_key,
109 registry_timeout_key,117 registry_timeout_key,
110 child_scopes_timeout_key,118 child_scopes_timeout_key,
111 registry_endpoint_dir_key,119 registry_endpoint_dir_key,
@@ -135,6 +143,11 @@
135 return locate_timeout_;143 return locate_timeout_;
136}144}
137145
146int ZmqConfig::debug_locate_timeout() const
147{
148 return debug_locate_timeout_;
149}
150
138int ZmqConfig::registry_timeout() const151int ZmqConfig::registry_timeout() const
139{152{
140 return registry_timeout_;153 return registry_timeout_;
141154
=== modified file 'src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp'
--- src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2015-05-06 05:45:30 +0000
+++ src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp 2015-06-29 15:09:40 +0000
@@ -106,6 +106,7 @@
106106
107 twoway_timeout_ = config.twoway_timeout();107 twoway_timeout_ = config.twoway_timeout();
108 locate_timeout_ = config.locate_timeout();108 locate_timeout_ = config.locate_timeout();
109 debug_locate_timeout_ = config.debug_locate_timeout();
109 registry_timeout_ = config.registry_timeout();110 registry_timeout_ = config.registry_timeout();
110 child_scopes_timeout_ = config.child_scopes_timeout();111 child_scopes_timeout_ = config.child_scopes_timeout();
111 public_endpoint_dir_ = config.endpoint_dir();112 public_endpoint_dir_ = config.endpoint_dir();
@@ -810,6 +811,11 @@
810 return locate_timeout_;811 return locate_timeout_;
811}812}
812813
814int64_t ZmqMiddleware::debug_locate_timeout() const noexcept
815{
816 return debug_locate_timeout_;
817}
818
813int64_t ZmqMiddleware::registry_timeout() const noexcept819int64_t ZmqMiddleware::registry_timeout() const noexcept
814{820{
815 return registry_timeout_;821 return registry_timeout_;
816822
=== modified file 'src/scopes/internal/zmq_middleware/ZmqScope.cpp'
--- src/scopes/internal/zmq_middleware/ZmqScope.cpp 2015-06-26 09:00:04 +0000
+++ src/scopes/internal/zmq_middleware/ZmqScope.cpp 2015-06-29 15:09:40 +0000
@@ -325,7 +325,8 @@
325 capnp::MallocMessageBuilder request_builder;325 capnp::MallocMessageBuilder request_builder;
326 make_request_(request_builder, "debug_mode");326 make_request_(request_builder, "debug_mode");
327327
328 auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder, -1, 30000); });328 int64_t timeout = mw_base()->debug_locate_timeout();
329 auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder, -1, timeout); });
329 auto out_params = future.get();330 auto out_params = future.get();
330 auto response = out_params.reader->getRoot<capnproto::Response>();331 auto response = out_params.reader->getRoot<capnproto::Response>();
331 throw_if_runtime_exception(response);332 throw_if_runtime_exception(response);
@@ -345,10 +346,11 @@
345ZmqObjectProxy::TwowayOutParams ZmqScope::invoke_scope_(capnp::MessageBuilder& in_params, int64_t timeout)346ZmqObjectProxy::TwowayOutParams ZmqScope::invoke_scope_(capnp::MessageBuilder& in_params, int64_t timeout)
346{347{
347 // Check if this scope has requested debug mode, if so, disable two-way timeout and set348 // Check if this scope has requested debug mode, if so, disable two-way timeout and set
348 // locate timeout to 30s.349 // locate timeout to debug_locate_timeout.
349 if (debug_mode())350 if (debug_mode())
350 {351 {
351 return this->invoke_twoway_(in_params, -1, 30000);352 int64_t timeout = mw_base()->debug_locate_timeout();
353 return this->invoke_twoway_(in_params, -1, timeout);
352 }354 }
353 return this->invoke_twoway_(in_params, timeout);355 return this->invoke_twoway_(in_params, timeout);
354}356}

Subscribers

People subscribed via source and target branches

to all changes: