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

Change subject: KUDU-3524 Fix core of sending keep-alive requests periodically
......................................................................


Patch Set 4:

(9 comments)

Thank you for the fix!  Overall looks OK, just a few nits.

http://gerrit.cloudera.org:8080/#/c/20739/4//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/20739/4//COMMIT_MSG@7
PS4, Line 7: Fix core of sending keep-alive requests periodically
How about:

  fix crash when sending periodic keep-alive requests

A core isn't necessarily generated upon a crash of a process, it depends on 
particular settings settings in the environment.


http://gerrit.cloudera.org:8080/#/c/20739/4//COMMIT_MSG@9
PS4, Line 9: Currently, calling the interface 'StartKeepAlivePeriodically()'
           : in kudu client will core in macOS, see KUDU-3542 for detail
how about:

Currently, Kudu client applications on macOS crash upon calling 
StartKeepAlivePeriodically(), see KUDU-3542 for details.


http://gerrit.cloudera.org:8080/#/c/20739/4//COMMIT_MSG@11
PS4, Line 11: That because this interface uses 'PeriodicTimer' to send 
keep-alive
            : requests periodically, and 'PeriodicTimer' uses reactor thread to 
do
            : it. Reactor thread does not allow to wait, and will check it, see 
the
            : function ReactorThread::RunThread(). But sending keep-alive 
requests
            : uses the synchronous interface 'ScannerKeepAlive()', which will 
wait
            : for the response.
That's because a PeriodicTimer was used to send keep-alive requests in a 
synchronous manner, while attempting to wait for the response on a reactor 
thread.  However, reactor threads do not allow for waiting.


http://gerrit.cloudera.org:8080/#/c/20739/4//COMMIT_MSG@18
PS4, Line 18: a
an


http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.h
File src/kudu/client/scanner-internal.h:

http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.h@289
PS4, Line 289:
style nit: indent should be 1 space from the start of the outer 'struct' scope, 
something like

  struct KeepAliveResponseCallback {
   public:
    KeepAliveResponseCallback() {}
  }


http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.h@290
PS4, Line 290:  {}
nit: could use '= default' here as well?


http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.cc
File src/kudu/client/scanner-internal.cc:

http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.cc@105
PS4, Line 105: "Send keep-alive request failed, reason: "
             :                    << controller.status().ToString();
nit: consider using Substitute() to format the message:


Substitute("failed to send keep-alive request: $0", 
controller.status().ToString())


http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.cc@126
PS4, Line 126: auto* cb = new KeepAliveResponseCallback();
Could please you add a comment before this line:

// 'cb' deletes itself upon completion.


http://gerrit.cloudera.org:8080/#/c/20739/4/src/kudu/client/scanner-internal.cc@130
PS4, Line 130: , ScannerKeepAlive sends keep alive requests
             :         // synchronous and waits the response. See KUDU-3524.
nit: I guess you could omit this long explanation since the first part of the 
sentence already provides the reasoning



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I130db970a091cdf7689245a79dc4ea445d1f739f
Gerrit-Change-Number: 20739
Gerrit-PatchSet: 4
Gerrit-Owner: Wang Xixu <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Wang Xixu <[email protected]>
Gerrit-Reviewer: Yifan Zhang <[email protected]>
Gerrit-Reviewer: Yingchun Lai <[email protected]>
Gerrit-Comment-Date: Thu, 14 Dec 2023 06:09:01 +0000
Gerrit-HasComments: Yes

Reply via email to