You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Mike Percy (Code Review)" <ge...@cloudera.org> on 2017/11/17 02:21:12 UTC

[kudu-CR] Add scoped macros to allow/disallow IO and waiting

Hello Andrew Wong,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/8583

to review the following change.


Change subject: Add scoped macros to allow/disallow IO and waiting
......................................................................

Add scoped macros to allow/disallow IO and waiting

This patch takes the existing ScopedAllowIO/Wait helper classes, part of
the ThreadRestrictions utility library, and makes the following
improvements:

1. Allows for expressing a "scoped disallow" in addition to the
   "scoped allow" for IO and waiting.
2. Creates macros to easily instantiate the scoped objects.

It is useful to be able to express a "scoped disallow" because a thread
that may perform I/O may have critical sections where I/O should not be
performed due to the risk of device failure. Instantiating a "scoped
disallow" for IO establishes an invariant that can be used to help
future-proof IO-free sections of code.

This patch also extends the existing unit tests to provide coverage for
the "scoped disallow" functionality.

Change-Id: I47725fc0c62dfa0b48d76c169ed8fd6a500599a6
---
M src/kudu/client/client-internal.cc
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc_stub-test.cc
M src/kudu/util/thread-test.cc
M src/kudu/util/thread_restrictions.h
5 files changed, 42 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/83/8583/1
-- 
To view, visit http://gerrit.cloudera.org:8080/8583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I47725fc0c62dfa0b48d76c169ed8fd6a500599a6
Gerrit-Change-Number: 8583
Gerrit-PatchSet: 1
Gerrit-Owner: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>

[kudu-CR] Add scoped macros to allow/disallow IO and waiting

Posted by "Mike Percy (Code Review)" <ge...@cloudera.org>.
Mike Percy has posted comments on this change. ( http://gerrit.cloudera.org:8080/8583 )

Change subject: Add scoped macros to allow/disallow IO and waiting
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/8583/1/src/kudu/util/thread_restrictions.h
File src/kudu/util/thread_restrictions.h:

http://gerrit.cloudera.org:8080/#/c/8583/1/src/kudu/util/thread_restrictions.h@65
PS1, Line 65:   // Constructing a ScopedAllowIO temporarily allows IO for the current
Hmm. I should have updated the class comments here and below. I'll do that.



-- 
To view, visit http://gerrit.cloudera.org:8080/8583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I47725fc0c62dfa0b48d76c169ed8fd6a500599a6
Gerrit-Change-Number: 8583
Gerrit-PatchSet: 1
Gerrit-Owner: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>
Gerrit-Comment-Date: Fri, 17 Nov 2017 02:30:06 +0000
Gerrit-HasComments: Yes

[kudu-CR] Add scoped macros to allow/disallow IO and waiting

Posted by "Mike Percy (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Andrew Wong, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/8583

to look at the new patch set (#2).

Change subject: Add scoped macros to allow/disallow IO and waiting
......................................................................

Add scoped macros to allow/disallow IO and waiting

This patch takes the existing ScopedAllowIO/Wait helper classes, part of
the ThreadRestrictions utility library, and makes the following
improvements:

1. Allows for expressing a "scoped disallow" in addition to the
   "scoped allow" for IO and waiting.
2. Creates macros to easily instantiate the scoped objects.

It is useful to be able to express a "scoped disallow" because a thread
that may perform I/O may have critical sections where I/O should not be
performed due to the risk of device failure. Instantiating a "scoped
disallow" for IO establishes an invariant that can be used to help
future-proof IO-free sections of code.

This patch also extends the existing unit tests to provide coverage for
the "scoped disallow" functionality.

Change-Id: I47725fc0c62dfa0b48d76c169ed8fd6a500599a6
---
M src/kudu/client/client-internal.cc
M src/kudu/rpc/messenger.cc
M src/kudu/rpc/rpc_stub-test.cc
M src/kudu/util/thread-test.cc
M src/kudu/util/thread_restrictions.h
5 files changed, 57 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/83/8583/2
-- 
To view, visit http://gerrit.cloudera.org:8080/8583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47725fc0c62dfa0b48d76c169ed8fd6a500599a6
Gerrit-Change-Number: 8583
Gerrit-PatchSet: 2
Gerrit-Owner: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>

[kudu-CR] Add scoped macros to allow/disallow IO and waiting

Posted by "Mike Percy (Code Review)" <ge...@cloudera.org>.
Mike Percy has abandoned this change. ( http://gerrit.cloudera.org:8080/8583 )

Change subject: Add scoped macros to allow/disallow IO and waiting
......................................................................


Abandoned

Not clear this is needed, abandoning for now.
-- 
To view, visit http://gerrit.cloudera.org:8080/8583
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I47725fc0c62dfa0b48d76c169ed8fd6a500599a6
Gerrit-Change-Number: 8583
Gerrit-PatchSet: 2
Gerrit-Owner: Mike Percy <mp...@apache.org>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mp...@apache.org>