[ 
https://issues.apache.org/jira/browse/YARN-11745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913859#comment-17913859
 ] 

ASF GitHub Bot commented on YARN-11745:
---------------------------------------

hadoop-yetus commented on PR #7278:
URL: https://github.com/apache/hadoop/pull/7278#issuecomment-2596915318

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 50s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to 
include 1 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  39m  1s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   1m  0s |  |  trunk passed with JDK 
Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04  |
   | +1 :green_heart: |  compile  |   0m 51s |  |  trunk passed with JDK 
Private Build-1.8.0_432-8u432-ga~us1-0ubuntu2~20.04-ga  |
   | +1 :green_heart: |  checkstyle  |   0m 56s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 56s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 55s |  |  trunk passed with JDK 
Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 48s |  |  trunk passed with JDK 
Private Build-1.8.0_432-8u432-ga~us1-0ubuntu2~20.04-ga  |
   | +1 :green_heart: |  spotbugs  |   1m 53s |  |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  37m 49s |  |  branch has no errors 
when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 46s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 53s |  |  the patch passed with JDK 
Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04  |
   | +1 :green_heart: |  javac  |   0m 53s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 43s |  |  the patch passed with JDK 
Private Build-1.8.0_432-8u432-ga~us1-0ubuntu2~20.04-ga  |
   | +1 :green_heart: |  javac  |   0m 43s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 44s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 45s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 44s |  |  the patch passed with JDK 
Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 40s |  |  the patch passed with JDK 
Private Build-1.8.0_432-8u432-ga~us1-0ubuntu2~20.04-ga  |
   | +1 :green_heart: |  spotbugs  |   1m 53s |  |  the patch passed  |
   | +1 :green_heart: |  shadedclient  |  38m 39s |  |  patch has no errors 
when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  | 107m 41s |  |  
hadoop-yarn-server-resourcemanager in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 35s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   | 238m 46s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.47 ServerAPI=1.47 base: 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7278/5/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/7278 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
   | uname | Linux dc9e584e132d 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 
13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / e6887fea87fa346923adf789268d9bb11b3ea4ed |
   | Default Java | Private Build-1.8.0_432-8u432-ga~us1-0ubuntu2~20.04-ga |
   | Multi-JDK versions | 
/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu120.04 
/usr/lib/jvm/java-8-openjdk-amd64:Private 
Build-1.8.0_432-8u432-ga~us1-0ubuntu2~20.04-ga |
   |  Test Results | 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7278/5/testReport/ |
   | Max. process+thread count | 927 (vs. ulimit of 5500) |
   | modules | C: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
 U: 
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager
 |
   | Console output | 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-7278/5/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.
   
   




> YARN ResourceManager throws java.lang.IllegalArgumentExceptio: Comparison 
> method violates its general contract!
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-11745
>                 URL: https://issues.apache.org/jira/browse/YARN-11745
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: yarn
>    Affects Versions: 3.4.0
>            Reporter: chhinlinghean
>            Assignee: chhinlinghean
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: ExampleZeroQueueResourceproblem.pdf
>
>
> The TimSort Transitivity rules got broken down when comparing both queues 
> with resources (0, 0), another queue with resources(some number, some number) 
> and with the same queues absolute capacity.
> *Steps reproduce with Unit test:*
> /hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/policy/TestPriorityUtilizationQueueOrderingPolicy.java
> {code:java}
> @Test
> public void testPriorityQueueComparatorClassDoesNotViolateTimSortContract() {
>   String partition = "testPartition";
>   
> List<PriorityUtilizationQueueOrderingPolicy.PriorityQueueResourcesForSorting> 
> queues = new ArrayList<>();
>   for (int i = 0; i < 300; i++) { // Have to be from 300 to make the test 
> deterministic
>     queues.add(createMockPriorityQueueResourcesForSorting(
>             partition, Resource.newInstance(0, 0)) // Need to be (0, 0)
>     );
>     queues.add(createMockPriorityQueueResourcesForSorting(
>             partition, Resource.newInstance(8, 20)) // Could be any number
>     );
>     queues.add(createMockPriorityQueueResourcesForSorting(
>             partition, Resource.newInstance(8, 8)) // Could be any number
>     );
>   }
>   Collections.shuffle(queues);
>   // java.lang.IllegalArgumentException: Comparison method violates its 
> general contract!
>   assertDoesNotThrow(() -> Collections.sort(queues, new 
> PriorityUtilizationQueueOrderingPolicy(true)
>           .new PriorityQueueComparator(partition)));
> }
> private 
> PriorityUtilizationQueueOrderingPolicy.PriorityQueueResourcesForSorting
>   createMockPriorityQueueResourcesForSorting(String partition, Resource 
> resource)
> {
>   QueueCapacities mockQueueCapacities = mock(QueueCapacities.class);
>   
> when(mockQueueCapacities.getAbsoluteUsedCapacity(partition)).thenReturn(3.2f);
>  // Could be any number
>   when(mockQueueCapacities.getUsedCapacity(partition)).thenReturn(1.0f); // 
> Could be any number
>   when(mockQueueCapacities.getAbsoluteCapacity(partition)).thenReturn(4.2f); 
> // Could be any number
>   CSQueue mockQueue = mock(CSQueue.class);
>   when(mockQueue.getQueueCapacities()).thenReturn(mockQueueCapacities);
>   when(mockQueue.getPriority()).thenReturn(Priority.newInstance(5)); // Could 
> be any number
>   
> when(mockQueue.getAccessibleNodeLabels()).thenReturn(Collections.singleton("label1"));
>  // simulated label
>   QueueResourceQuotas mockResourceQuotas = mock(QueueResourceQuotas.class);
>   
> when(mockResourceQuotas.getConfiguredMinResource(partition)).thenReturn(resource);
>   when(mockQueue.getQueueResourceQuotas()).thenReturn(mockResourceQuotas);
>   return new 
> PriorityUtilizationQueueOrderingPolicy.PriorityQueueResourcesForSorting(
>           mockQueue, partition
>   );{code}
> *How to fix it?*
> Instead of checking with an AND condition when both queues resources are not 
> none to compare its resources, we should check with an OR condition instead. 
> Because in the case one queue's resource is none another one is not we should 
> still compare by its resources.
> Previous code:
> {code:java}
> if (!minEffRes1.equals(Resources.none()) && 
> !minEffRes2.equals(Resources.none())) {
>   return minEffRes2.compareTo(minEffRes1);
> }
> float abs1 = q1Sort.absoluteCapacity;
> float abs2 = q2Sort.absoluteCapacity;
> return Float.compare(abs2, abs1); {code}
> Changed code to:
> {code:java}
> if (!minEffRes1.equals(Resources.none()) || 
> !minEffRes2.equals(Resources.none())) {
>   return minEffRes2.compareTo(minEffRes1);
> }
> float abs1 = q1Sort.absoluteCapacity;
> float abs2 = q2Sort.absoluteCapacity;
> return Float.compare(abs2, abs1); {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to