Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18467 )

Change subject: util: pull jwt code from Impala
......................................................................


Patch Set 10:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/18467/10/src/kudu/util/jwt-util.cc
File src/kudu/util/jwt-util.cc:

http://gerrit.cloudera.org:8080/#/c/18467/10/src/kudu/util/jwt-util.cc@728
PS10, Line 728:   int64_t timeout_millis = 
static_cast<int64_t>(FLAGS_jwks_update_frequency_s) * 1000;
              :   const MonoDelta &timeout = 
MonoDelta::FromMilliseconds(timeout_millis);
nit: this could be just

const MonoDelta timeout = MonoDelta::FromSeconds(FLAGS_jwks_update_frequency_s);


http://gerrit.cloudera.org:8080/#/c/18467/10/src/kudu/util/jwt-util.cc@732
PS10, Line 732: bool timed_out = shut_down_promise_.WaitFor(timeout);
> WaitFor() returns nullptr if the timeout elapses so timed_out should be tru
Good point.  I'd vote for

  if (shut_down_promise_.WaitFor(timeout) != nullptr) {
    // Shutdown has happened, stop updating JWKS.
    break;
  }

since it doesn't introduce useless variables.

Also, adding a comment helps to increase readability.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib546762aa7ff53009f32688c30c5642ee4df494b
Gerrit-Change-Number: 18467
Gerrit-PatchSet: 10
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
Gerrit-Reviewer: Zoltan Chovan <[email protected]>
Gerrit-Comment-Date: Tue, 08 Nov 2022 19:59:29 +0000
Gerrit-HasComments: Yes

Reply via email to