Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add timeouts to node status and node ls #20308

Merged
merged 7 commits into from
Nov 30, 2017

Commits on Nov 30, 2017

  1. Configuration menu
    Copy the full SHA
    9000525 View commit details
    Browse the repository at this point in the history
  2. cli: remove spurious GRPC warnings

    GRPC in its recent versions has become quite noisy and in particular does not play well
    with context cancellation.
    
    Mute it in all client commands except when actually starting a server.
    tbg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    647d1a6 View commit details
    Browse the repository at this point in the history
  3. cli: don't mix contexts and stoppers

    Refactor the cli package to avoid the previously common mixing of stoppers and
    contexts. Nobody really needs the stopper usually (and if so, they could make
    their own); it is simpler to just have a context and cancel it when done.
    
    Touches cockroachdb#16489 (by making it more straightforward to use timeouts).
    tbg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    7a3cdaa View commit details
    Browse the repository at this point in the history
  4. cli: add --timeout to node ls|status

    Defaults to no timeout.
    
    Both of these commands internally do a KV scan, which
    may never finish on a sufficiently broken cluster.
    
    Release note (cli change): the `node status` and `node ls` commands now support a timeout.
    
    Updates cockroachdb#16489.
    tbg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    9159fae View commit details
    Browse the repository at this point in the history
  5. cli: remove stopperContext

    tbg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    e289000 View commit details
    Browse the repository at this point in the history
  6. cli: grpc logs at WARNING for start, ERROR for rest

    This avoids muddling up client output with noisy GRPC connection chatter,
    but lease some amount of logging in place for hard errors (which I have
    never seen in practice).
    tbg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    36e49db View commit details
    Browse the repository at this point in the history
  7. cli: wait for connection cleanup

    I refactored this to rely solely on context cancellation in
    a previous commit. Unfortunately, we run cli tools multiple
    times in the same process during tests, and we reset globals
    that are picked up by the RPCContext used by open connections,
    which results in data races.
    
    Return a closure from getClientGRPCConn which waits for the
    Stopper to stop to circumvent this.
    tbg committed Nov 30, 2017
    Configuration menu
    Copy the full SHA
    da5dca5 View commit details
    Browse the repository at this point in the history