Skip to content

Conversation

haiyang1987
Copy link
Contributor

Description of PR

https://issues.apache.org/jira/browse/HDFS-17461

Fix spotbugs in PeerCache#getInternal

Spotbugs warnings:
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6710/4/artifact/out/branch-spotbugs-hadoop-hdfs-project_hadoop-hdfs-client-warnings.html

private final LinkedListMultimap<Key, Value> multimap = LinkedListMultimap.create();
Returns a collection view containing the values associated with key in this multimap, if any. Note that even when (containsKey(key) is false, get(key) still returns an empty collection, not null.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 31s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 45m 53s trunk passed
+1 💚 compile 1m 2s trunk passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 compile 0m 54s trunk passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 checkstyle 0m 30s trunk passed
+1 💚 mvnsite 0m 57s trunk passed
+1 💚 javadoc 0m 49s trunk passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javadoc 0m 39s trunk passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
-1 ❌ spotbugs 2m 50s /branch-spotbugs-hadoop-hdfs-project_hadoop-hdfs-client-warnings.html hadoop-hdfs-project/hadoop-hdfs-client in trunk has 1 extant spotbugs warnings.
+1 💚 shadedclient 39m 26s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 50s the patch passed
+1 💚 compile 0m 53s the patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javac 0m 53s the patch passed
+1 💚 compile 0m 46s the patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 javac 0m 46s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 mvnsite 0m 49s the patch passed
+1 💚 javadoc 0m 33s the patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javadoc 0m 31s the patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 spotbugs 2m 39s hadoop-hdfs-project/hadoop-hdfs-client generated 0 new + 0 unchanged - 1 fixed = 0 total (was 1)
+1 💚 shadedclient 37m 22s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 26s hadoop-hdfs-client in the patch passed.
+1 💚 asflicense 0m 35s The patch does not generate ASF License warnings.
143m 36s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/1/artifact/out/Dockerfile
GITHUB PR #6721
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 33e5234aa821 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4116fa0
Default Java Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/1/testReport/
Max. process+thread count 552 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Comment on lines 158 to 159
List<Value> sockStreamList = multimap.get(new Key(dnId, isDomain));
if (sockStreamList == null) {
if (sockStreamList.isEmpty()) {
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just drop this if check itself, the below logic can safely handle an empty list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ayushtkn for your comment.
Update PR, please help me review it again, thanks~

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 31s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 47m 0s trunk passed
+1 💚 compile 1m 3s trunk passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 compile 0m 56s trunk passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 checkstyle 0m 30s trunk passed
+1 💚 mvnsite 0m 58s trunk passed
+1 💚 javadoc 0m 47s trunk passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javadoc 0m 39s trunk passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
-1 ❌ spotbugs 2m 51s /branch-spotbugs-hadoop-hdfs-project_hadoop-hdfs-client-warnings.html hadoop-hdfs-project/hadoop-hdfs-client in trunk has 1 extant spotbugs warnings.
+1 💚 shadedclient 37m 54s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 50s the patch passed
+1 💚 compile 0m 54s the patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javac 0m 54s the patch passed
+1 💚 compile 0m 46s the patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 javac 0m 46s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 mvnsite 0m 49s the patch passed
+1 💚 javadoc 0m 35s the patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javadoc 0m 32s the patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 spotbugs 2m 50s hadoop-hdfs-project/hadoop-hdfs-client generated 0 new + 0 unchanged - 1 fixed = 0 total (was 1)
+1 💚 shadedclient 39m 36s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 25s hadoop-hdfs-client in the patch passed.
+1 💚 asflicense 0m 36s The patch does not generate ASF License warnings.
144m 59s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/2/artifact/out/Dockerfile
GITHUB PR #6721
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 05f56d1e9843 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / c5e1b9d
Default Java Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/2/testReport/
Max. process+thread count 555 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@Hexiaoqiao
Copy link
Contributor

Still report spotbugs at latest. Try to trigger CI again, let's wait what it will say.

@ayushtkn
Copy link
Member

That spotbug warning is for the trunk, without the patch
image

With the patch it shows fixed
image

Copy link
Contributor

@ZanderXu ZanderXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 35s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 48m 25s trunk passed
+1 💚 compile 1m 0s trunk passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 compile 0m 54s trunk passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 checkstyle 0m 32s trunk passed
+1 💚 mvnsite 0m 59s trunk passed
+1 💚 javadoc 0m 48s trunk passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javadoc 0m 38s trunk passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
-1 ❌ spotbugs 2m 44s /branch-spotbugs-hadoop-hdfs-project_hadoop-hdfs-client-warnings.html hadoop-hdfs-project/hadoop-hdfs-client in trunk has 1 extant spotbugs warnings.
+1 💚 shadedclient 39m 11s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 50s the patch passed
+1 💚 compile 0m 57s the patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javac 0m 57s the patch passed
+1 💚 compile 0m 50s the patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 javac 0m 50s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 20s the patch passed
+1 💚 mvnsite 0m 49s the patch passed
+1 💚 javadoc 0m 34s the patch passed with JDK Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1
+1 💚 javadoc 0m 33s the patch passed with JDK Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
+1 💚 spotbugs 2m 49s hadoop-hdfs-project/hadoop-hdfs-client generated 0 new + 0 unchanged - 1 fixed = 0 total (was 1)
+1 💚 shadedclient 40m 40s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 30s hadoop-hdfs-client in the patch passed.
+1 💚 asflicense 0m 36s The patch does not generate ASF License warnings.
150m 2s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/3/artifact/out/Dockerfile
GITHUB PR #6721
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 43732dbc5805 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / c5e1b9d
Default Java Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.22+7-post-Ubuntu-0ubuntu220.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_402-8u402-ga-2ubuntu1~20.04-b06
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/3/testReport/
Max. process+thread count 552 (vs. ulimit of 5500)
modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6721/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@Hexiaoqiao
Copy link
Contributor

Hi @ayushtkn , 'With the patch it shows fixed' where is this report link, hadoop-yetus comment here is not the correct one? Thanks.

That spotbug warning is for the trunk, without the patch image

With the patch it shows fixed image

@ayushtkn
Copy link
Member

@Hexiaoqiao If you check the previous Jenkins result, it has two runs for the spotbugs, one without patch, just on trunk & then with patch.
Without patch, on trunk it is red, with the patch it is green
image
If you see above, I made two boxes, the first one shows the spotbugs run on trunk & the later one shows on the patch which is green

On trunk without patch it is red, because Spotbugs is broken without this patch, Since we fixed it in the current patch, it went green for the patch run

@Hexiaoqiao
Copy link
Contributor

@ayushtkn Got it. Thanks!

Copy link
Contributor

@Hexiaoqiao Hexiaoqiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. +1.

@Hexiaoqiao Hexiaoqiao merged commit 6ccb223 into apache:trunk Apr 12, 2024
@Hexiaoqiao
Copy link
Contributor

Committed to trunk. Thanks @haiyang1987 , @ZanderXu and @ayushtkn !

@haiyang1987
Copy link
Contributor Author

Thanks @Hexiaoqiao @ayushtkn @ZanderXu for your review and merge it.

sadanand48 pushed a commit to sadanand48/hadoop that referenced this pull request Oct 1, 2024
…ributed by Haiyang Hu.

Reviewed-by: ZanderXu <[email protected]>
Reviewed-by: Ayush Saxena <[email protected]>
Signed-off-by: He Xiaoqiao <[email protected]>
(cherry picked from commit 6ccb223)
sadanand48 pushed a commit to sadanand48/hadoop that referenced this pull request Oct 1, 2024
sadanand48 pushed a commit to sadanand48/hadoop that referenced this pull request Oct 2, 2024
…ributed by Haiyang Hu.

Reviewed-by: ZanderXu <[email protected]>
Reviewed-by: Ayush Saxena <[email protected]>
Signed-off-by: He Xiaoqiao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants