You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2026/04/15 07:10:36 UTC

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24194


Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................

modernize code with WARN_UNUSED_RESULT attribute

Since introduction of the 'nodiscard' attribute for Status [1] and
adding `-Werror` compiler flag [2], there isn't a need to annotate
methods/functions with WARN_UNUSED_RESULT in the C++ code that is
supposed to compile with the C++17 and newer standards.  This changelist
removes the WARN_UNUSED_RESULT where applicable, and also replaces
WARN_UNUSED_RESULT with [[nodiscard]] for methods/functions returning
other than Status types.

NOTE: it's still there for code that's compiled with the C++98 standard.

This changelist doesn't contain any functional modifications.

[1] https://github.com/apache/kudu/commit/8f136bb21
[2] https://github.com/apache/kudu/commit/ef7483f78

Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
---
M src/kudu/client/batcher.h
M src/kudu/client/client-test-util.h
M src/kudu/client/scan_configuration.h
M src/kudu/clock/hybrid_clock.h
M src/kudu/clock/test/mini_chronyd.h
M src/kudu/clock/test/mini_chronyd_test_util.h
M src/kudu/common/key_util.h
M src/kudu/common/table_util.h
M src/kudu/consensus/raft_consensus.h
M src/kudu/gutil/basictypes.h
M src/kudu/hms/hms_catalog.h
M src/kudu/hms/hms_client.h
M src/kudu/hms/mini_hms.h
M src/kudu/integration-tests/hms_itest-base.h
M src/kudu/master/authz_provider.h
M src/kudu/master/auto_rebalancer.h
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
M src/kudu/master/default_authz_provider.h
M src/kudu/master/hms_notification_log_listener.h
M src/kudu/master/master.h
M src/kudu/master/ranger_authz_provider.h
M src/kudu/master/sys_catalog.h
M src/kudu/mini-cluster/external_mini_cluster.h
M src/kudu/postgres/mini_postgres.h
M src/kudu/ranger-kms/mini_ranger_kms.h
M src/kudu/ranger/mini_ranger.h
M src/kudu/ranger/ranger_client.h
M src/kudu/rpc/client_negotiation.h
M src/kudu/rpc/sasl_common.h
M src/kudu/rpc/server_negotiation.h
M src/kudu/security/ca/cert_management.h
M src/kudu/security/cert.h
M src/kudu/security/crypto.h
M src/kudu/security/test/mini_kdc.h
M src/kudu/security/tls_context.h
M src/kudu/security/tls_handshake.h
M src/kudu/security/tls_socket.h
M src/kudu/security/token_signer.h
M src/kudu/security/token_signing_key.h
M src/kudu/security/token_verifier.h
M src/kudu/server/rpc_server.h
M src/kudu/server/webserver.h
M src/kudu/subprocess/server.h
M src/kudu/tablet/mvcc.h
M src/kudu/tablet/tablet.h
M src/kudu/thrift/client.h
M src/kudu/tools/tool_action_common.h
M src/kudu/tserver/scanners.h
M src/kudu/util/cloud/instance_detector.h
M src/kudu/util/cloud/instance_metadata.h
M src/kudu/util/faststring.h
M src/kudu/util/init.h
M src/kudu/util/mini_oidc.h
M src/kudu/util/net/diagnostic_socket.h
M src/kudu/util/openssl_util.h
M src/kudu/util/path_util.h
M src/kudu/util/rolling_log.h
M src/kudu/util/subprocess.h
M src/kudu/util/test_util.h
M src/kudu/util/threadpool.h
M src/kudu/util/version_util.h
62 files changed, 366 insertions(+), 385 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

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

Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................


Patch Set 1:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/2471/


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 15 Apr 2026 07:10:44 +0000
Gerrit-HasComments: No

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

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

Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................


Patch Set 1: Verified+1 Code-Review+2

Thanks for taking care of this modernization Alexey!

Unrelated test failure:
tsan: master_failover-itest.1


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Wed, 15 Apr 2026 10:24:49 +0000
Gerrit-HasComments: No

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24194 )

Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................

modernize code with WARN_UNUSED_RESULT attribute

Since introduction of the 'nodiscard' attribute for Status [1] and
adding `-Werror` compiler flag [2], there isn't a need to annotate
methods/functions with WARN_UNUSED_RESULT in the C++ code that is
supposed to compile with the C++17 and newer standards.  This changelist
removes the WARN_UNUSED_RESULT where applicable, and also replaces
WARN_UNUSED_RESULT with [[nodiscard]] for methods/functions returning
other than Status types.

NOTE: it's still there for code that's compiled with the C++98 standard.

This changelist doesn't contain any functional modifications.

[1] https://github.com/apache/kudu/commit/8f136bb21
[2] https://github.com/apache/kudu/commit/ef7483f78

Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Reviewed-on: http://gerrit.cloudera.org:8080/24194
Reviewed-by: Marton Greber <gr...@gmail.com>
Tested-by: Marton Greber <gr...@gmail.com>
Reviewed-by: Gabriella Lotz <lo...@gmail.com>
---
M src/kudu/client/batcher.h
M src/kudu/client/client-test-util.h
M src/kudu/client/scan_configuration.h
M src/kudu/clock/hybrid_clock.h
M src/kudu/clock/test/mini_chronyd.h
M src/kudu/clock/test/mini_chronyd_test_util.h
M src/kudu/common/key_util.h
M src/kudu/common/table_util.h
M src/kudu/consensus/raft_consensus.h
M src/kudu/gutil/basictypes.h
M src/kudu/hms/hms_catalog.h
M src/kudu/hms/hms_client.h
M src/kudu/hms/mini_hms.h
M src/kudu/integration-tests/hms_itest-base.h
M src/kudu/master/authz_provider.h
M src/kudu/master/auto_rebalancer.h
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
M src/kudu/master/default_authz_provider.h
M src/kudu/master/hms_notification_log_listener.h
M src/kudu/master/master.h
M src/kudu/master/ranger_authz_provider.h
M src/kudu/master/sys_catalog.h
M src/kudu/mini-cluster/external_mini_cluster.h
M src/kudu/postgres/mini_postgres.h
M src/kudu/ranger-kms/mini_ranger_kms.h
M src/kudu/ranger/mini_ranger.h
M src/kudu/ranger/ranger_client.h
M src/kudu/rpc/client_negotiation.h
M src/kudu/rpc/sasl_common.h
M src/kudu/rpc/server_negotiation.h
M src/kudu/security/ca/cert_management.h
M src/kudu/security/cert.h
M src/kudu/security/crypto.h
M src/kudu/security/test/mini_kdc.h
M src/kudu/security/tls_context.h
M src/kudu/security/tls_handshake.h
M src/kudu/security/tls_socket.h
M src/kudu/security/token_signer.h
M src/kudu/security/token_signing_key.h
M src/kudu/security/token_verifier.h
M src/kudu/server/rpc_server.h
M src/kudu/server/webserver.h
M src/kudu/subprocess/server.h
M src/kudu/tablet/mvcc.h
M src/kudu/tablet/tablet.h
M src/kudu/thrift/client.h
M src/kudu/tools/tool_action_common.h
M src/kudu/tserver/scanners.h
M src/kudu/util/cloud/instance_detector.h
M src/kudu/util/cloud/instance_metadata.h
M src/kudu/util/faststring.h
M src/kudu/util/init.h
M src/kudu/util/mini_oidc.h
M src/kudu/util/net/diagnostic_socket.h
M src/kudu/util/openssl_util.h
M src/kudu/util/path_util.h
M src/kudu/util/rolling_log.h
M src/kudu/util/subprocess.h
M src/kudu/util/test_util.h
M src/kudu/util/threadpool.h
M src/kudu/util/version_util.h
62 files changed, 366 insertions(+), 385 deletions(-)

Approvals:
  Marton Greber: Looks good to me, approved; Verified
  Gabriella Lotz: Looks good to me, but someone else must approve

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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

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

Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................


Patch Set 1: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/2471/ : FAILURE


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Wed, 15 Apr 2026 08:00:50 +0000
Gerrit-HasComments: No

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has removed a vote on this change.

Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/24194
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>

[kudu-CR] modernize code with WARN UNUSED RESULT attribute

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

Change subject: modernize code with WARN_UNUSED_RESULT attribute
......................................................................


Patch Set 1: Code-Review+1


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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I83166e0dddec57e5b11ef958615848bde4165a72
Gerrit-Change-Number: 24194
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Gabriella Lotz <lo...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Comment-Date: Wed, 15 Apr 2026 11:11:27 +0000
Gerrit-HasComments: No