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

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 602
Merged at revision: 603
Proposed branch: lp:~marcustomlinson/unity-scopes-api/fix_debug_mode_locate_timeout
Merge into: lp:unity-scopes-api/devel
Diff against target: 42 lines (+5/-5)
2 files modified
scoperegistry/scoperegistry.cpp (+2/-2)
src/scopes/internal/zmq_middleware/ZmqScope.cpp (+3/-3)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/fix_debug_mode_locate_timeout
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Approve
Paweł Stołowski (community) Approve
Review via email: mp+263074@code.launchpad.net

Commit message

Allow 30s for locate() to complete when requesting a scope's debug_mode() status.

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

The main fix here is:

26 + auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder, -1, 30000); });

We need to actually use debug timeouts when requesting whether a scope is in debug mode :P

The problem is the initial locate() call that happens implicitly when making any request to a scope. This call was using the normal timeout constraint. Issue there is if a scope actually is in debug mode it takes longer to start up, hence that locate() call times out.

In the situation where a scope is not in debug mode but is starting up too slowly, it will not take 30s to timeout. In this case the registry's own "Process.Timeout" will kick in (which is configured according to the debug_mode status of each scope as it is added), causing the timeout to occur at a regular timeout for regular scope, and at an extended timeout for "debug mode" scopes.

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

Looks good to me. +1

review: Approve
Revision history for this message
Michi Henning (michihenning) wrote :

Looks reasonable. Not totally fond of the hard-wired constant there.

I'm not going to hold up this MR because of it. But should we make that a config item? If there is more than one place where that number is used, we probably should... If so, could you open a separate bug please?

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

Setting to needs review at the top level; Benjamin will top approve after verification.

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

> Looks reasonable. Not totally fond of the hard-wired constant there.
>
> I'm not going to hold up this MR because of it. But should we make that a
> config item? If there is more than one place where that number is used, we
> probably should... If so, could you open a separate bug please?

Yeah its a good point. Was just thinking about where to put those. I'm thinking a "Debug.Process.Timeout" in the registry config, and a "Debug.Locate.Timeout" in the ZMQ config. Sound good?

Revision history for this message
Michi Henning (michihenning) wrote :

Sounds good. Please remember to update the doxygen doc and/or CONFIGFILES as appropriate. No great urgency here. But, if we can't do this right away, please open a bug so we won't forget.

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

> Sounds good. Please remember to update the doxygen doc and/or CONFIGFILES as
> appropriate. No great urgency here. But, if we can't do this right away,
> please open a bug so we won't forget.

Bug created: https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1469105

Revision history for this message
Michi Henning (michihenning) wrote :

Thank you Sir! :-)

Michi.

On 26 Jun 2015, at 20:21 , Marcus Tomlinson <email address hidden> wrote:

>> Sounds good. Please remember to update the doxygen doc and/or CONFIGFILES as
>> appropriate. No great urgency here. But, if we can't do this right away,
>> please open a bug so we won't forget.
>
> Bug created: https://bugs.launchpad.net/ubuntu/+source/unity-scopes-api/+bug/1469105
> --
> https://code.launchpad.net/~marcustomlinson/unity-scopes-api/fix_debug_mode_locate_timeout/+merge/263074
> You are reviewing the proposed merge of lp:~marcustomlinson/unity-scopes-api/fix_debug_mode_locate_timeout into lp:unity-scopes-api/devel.

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

Benjamin has confirmed at least that the new debug timeouts do work, however, we're gonna hold off merging this MP until some other debugging issues are resolved.

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

> Benjamin has confirmed at least that the new debug timeouts do work, however,
> we're gonna hold off merging this MP until some other debugging issues are
> resolved.

Permission granted to top approve by Benjamin. Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scoperegistry/scoperegistry.cpp'
2--- scoperegistry/scoperegistry.cpp 2015-04-10 03:55:25 +0000
3+++ scoperegistry/scoperegistry.cpp 2015-06-26 09:03:50 +0000
4@@ -423,10 +423,10 @@
5 scope_dir.filename().native();
6 }
7
8- // Check if this scope has requested debug mode, if so, set the process timeout to 15s
9+ // Check if this scope has requested debug mode, if so, set the process timeout to 30s
10 if (sc.debug_mode())
11 {
12- exec_data.timeout_ms = 15000;
13+ exec_data.timeout_ms = 30000;
14 }
15 else
16 {
17
18=== modified file 'src/scopes/internal/zmq_middleware/ZmqScope.cpp'
19--- src/scopes/internal/zmq_middleware/ZmqScope.cpp 2015-05-29 12:02:54 +0000
20+++ src/scopes/internal/zmq_middleware/ZmqScope.cpp 2015-06-26 09:03:50 +0000
21@@ -325,7 +325,7 @@
22 capnp::MallocMessageBuilder request_builder;
23 make_request_(request_builder, "debug_mode");
24
25- auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder); });
26+ auto future = mw_base()->twoway_pool()->submit([&] { return this->invoke_twoway_(request_builder, -1, 30000); });
27 auto out_params = future.get();
28 auto response = out_params.reader->getRoot<capnproto::Response>();
29 throw_if_runtime_exception(response);
30@@ -345,10 +345,10 @@
31 ZmqObjectProxy::TwowayOutParams ZmqScope::invoke_scope_(capnp::MessageBuilder& in_params, int64_t timeout)
32 {
33 // Check if this scope has requested debug mode, if so, disable two-way timeout and set
34- // locate timeout to 15s.
35+ // locate timeout to 30s.
36 if (debug_mode())
37 {
38- return this->invoke_twoway_(in_params, -1, 15000);
39+ return this->invoke_twoway_(in_params, -1, 30000);
40 }
41 return this->invoke_twoway_(in_params, timeout);
42 }

Subscribers

People subscribed via source and target branches

to all changes: