Marton Greber has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23222 )

Change subject: WIP KUDU-3635 fix order of tcmalloc/OpenSSL finalization
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/23222/3/src/kudu/master/master_main.cc
File src/kudu/master/master_main.cc:

http://gerrit.cloudera.org:8080/#/c/23222/3/src/kudu/master/master_main.cc@57
PS3, Line 57: void module_init_tcmalloc() {
            : #if defined(TCMALLOC_ENABLED)
            :   // To prompt tcmalloc's initialization (if hasn't happened yet),
            :   // call one of its functions.
            :   kudu::process_memory::GetTCMallocCurrentAllocatedBytes();
            : #endif
            : }
            :
            : void module_fini_tcmalloc() {
            : #if defined(TCMALLOC_ENABLED) && !defined(NDEBUG)
            :   // Debug builds only: as an extra sanity check, poke tcmalloc a 
bit to make
            :   // sure it's not erroring out at this point.
            :   RAW_VLOG(2, "invoking tcmalloc GC");
            :   kudu::process_memory::GcTcmalloc();
            : #endif
            : }
            :
            : void module_init_openssl() {
            :   // In debug builds, make sure OpenSSL isn't yet initialized at 
this point.
            :   RAW_DCHECK(!kudu::security::IsOpenSSLInitialized(),
            :              "OpenSSL shouldn't be initialized yet");
            : }
            :
            : void module_fini_openssl() {
            :   // Call OPENSSL_cleanup() to release resources and clean up the 
global state
            :   // of the library (applicable to OpenSSL 1.1.0 and newer 
versions).
            :   RAW_VLOG(2, "cleaning up OpenSSL runtime");
            :   kudu::security::FinalizeOpenSSL();
            : }
I see that these functions occur in all the *main.cc files. Would it be 
possible to extract them into a header file, to avoid code duplication?


http://gerrit.cloudera.org:8080/#/c/23222/3/src/kudu/util/openssl_util.cc
File src/kudu/util/openssl_util.cc:

http://gerrit.cloudera.org:8080/#/c/23222/3/src/kudu/util/openssl_util.cc@254
PS3, Line 254: 0x10100000L
nit: shouldn't this be 0x10101000L?
(if my understanding is correct above we set OPENSSL_INIT_NO_ATEXIT if 
OPENSSL_VERSION_NUMBER >= 0x10101000L. In that case we do the cleanup in the 
finalize, right?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib08310d66a7eabb1996bde901f39f36f54bff483
Gerrit-Change-Number: 23222
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Comment-Date: Thu, 31 Jul 2025 15:38:47 +0000
Gerrit-HasComments: Yes

Reply via email to