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 2025/02/19 22:47:54 UTC
[kudu-CR] [util] add 'nodiscard' attribute for Status
Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/22504
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
[util] add 'nodiscard' attribute for Status
This patch helps to spot sloppy error handling and catch related
mistakes and bugs at compile time once Status class is marked with the
'nodiscard' attribute [1]. It has a potential of saving us time doing
debugging and troubleshooting, at least I know a few occasions where
it should have helped :)
With this patch, a non-handled result Status produces a compiler's
warning when compiling with CLANG or GCC13 and newer. People developing
on macOS and Ubuntu 24.04 can see that with this patch, and our ASAN and
TSAN pre-commit builds should produce corresponding warnings as well.
A follow-up changelist [2] turns warnings into errors. Once the
sloppiness in error handling is addressed throughout the existing code,
[2] should be added to guard against sloppy error handling
in newly added code.
[1] https://en.cppreference.com/w/cpp/language/attributes/nodiscard
[2] https://gerrit.cloudera.org/#/c/22489/
Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
---
M src/kudu/util/status.h
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/04/22504/1
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 2:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/1092/
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Feb 2025 04:33:44 +0000
Gerrit-HasComments: No
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
[util] add 'nodiscard' attribute for Status
This patch helps to spot sloppy error handling and catch related
mistakes and bugs at compile time once Status class is marked with the
'nodiscard' attribute [1]. It has a potential of saving us time doing
debugging and troubleshooting, at least I know a few occasions where
it should have helped :)
With this patch, a non-handled result Status produces a compiler's
warning when compiling with CLANG or GCC13 and newer. People developing
on macOS and Ubuntu 24.04 can see that with this patch, and our ASAN and
TSAN pre-commit builds should produce corresponding warnings as well.
A follow-up changelist [2] turns warnings into errors. Once the
sloppiness in error handling is addressed throughout the existing code,
[2] should be added to guard against sloppy error handling
in newly added code.
[1] https://en.cppreference.com/w/cpp/language/attributes/nodiscard
[2] https://gerrit.cloudera.org/#/c/22489/
Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Reviewed-on: http://gerrit.cloudera.org:8080/22504
Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
Tested-by: Alexey Serbin <al...@apache.org>
---
M src/kudu/util/status.h
1 file changed, 19 insertions(+), 1 deletion(-)
Approvals:
Abhishek Chennaka: Looks good to me, approved
Alexey Serbin: Verified
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Removed Verified+1 by Alexey Serbin <al...@apache.org>
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 1: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/1088/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Feb 2025 00:28:06 +0000
Gerrit-HasComments: No
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 1:
Build Started http://jenkins.kudu.apache.org/job/pre_commit/1088/
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 19 Feb 2025 22:48:02 +0000
Gerrit-HasComments: No
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 2: Verified+1
unrelated failures in known flaky tests
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Feb 2025 06:25:53 +0000
Gerrit-HasComments: No
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Removed Verified-1 by Kudu Jenkins (120)
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Zoltan Martonka, Attila Bukor, Yifan Zhang, Kudu Jenkins, Abhishek Chennaka,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/22504
to look at the new patch set (#2).
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
[util] add 'nodiscard' attribute for Status
This patch helps to spot sloppy error handling and catch related
mistakes and bugs at compile time once Status class is marked with the
'nodiscard' attribute [1]. It has a potential of saving us time doing
debugging and troubleshooting, at least I know a few occasions where
it should have helped :)
With this patch, a non-handled result Status produces a compiler's
warning when compiling with CLANG or GCC13 and newer. People developing
on macOS and Ubuntu 24.04 can see that with this patch, and our ASAN and
TSAN pre-commit builds should produce corresponding warnings as well.
A follow-up changelist [2] turns warnings into errors. Once the
sloppiness in error handling is addressed throughout the existing code,
[2] should be added to guard against sloppy error handling
in newly added code.
[1] https://en.cppreference.com/w/cpp/language/attributes/nodiscard
[2] https://gerrit.cloudera.org/#/c/22489/
Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
---
M src/kudu/util/status.h
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/04/22504/2
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 2: Verified-1
Build Failed
http://jenkins.kudu.apache.org/job/pre_commit/1092/ : FAILURE
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Feb 2025 05:20:08 +0000
Gerrit-HasComments: No
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Abhishek Chennaka (Code Review)" <ge...@cloudera.org>.
Abhishek Chennaka has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Feb 2025 06:00:46 +0000
Gerrit-HasComments: No
[kudu-CR] [util] add 'nodiscard' attribute for Status
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22504 )
Change subject: [util] add 'nodiscard' attribute for Status
......................................................................
Patch Set 2: Verified+1
--
To view, visit http://gerrit.cloudera.org:8080/22504
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1ec324e3bb5d10bc35f34ed2614e239a4a150446
Gerrit-Change-Number: 22504
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Abhishek Chennaka <ac...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yifan Zhang <ch...@163.com>
Gerrit-Reviewer: Zoltan Martonka <zm...@cloudera.com>
Gerrit-Comment-Date: Thu, 20 Feb 2025 06:26:07 +0000
Gerrit-HasComments: No