You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/05 08:01:49 UTC

[GitHub] [maven-resolver] weibo1995 opened a new pull request, #172: Fix the problem that the dependency tree is different when DF and BF …

weibo1995 opened a new pull request, #172:
URL: https://github.com/apache/maven-resolver/pull/172

   Fix the problem that the dependency tree is different when DF and BF strategies are adopted when a dependency package has no children dependency.
   When BF is adopted, when a dependent package has no children dependency, it will not continue to call the doRecurse() method, that is, it will not call the CacheManager.cachewinner() to put this dependency package into the winnerGAs object, which affects the analysis results of dependency packages of the same GA. The current fix is to call the CacheManager.cachewinner() method when a dependent package has no children dependency, so that the dependent package can be found in winnerGAs.
   
   
   
   We take the dependency in the following figure as an example to illustrate the generation process of the problem.
   ![image](https://user-images.githubusercontent.com/104960983/166883126-fad4a7cf-956e-4b89-9879-487fce2faf5f.png)
   
   At org eclipse. aether. internal. impl. Bfdependencycollector #collectdependencies() mainly has two stages: processdependency() and transformer.transformGraph( node, context )。
   In the first stage of process dependency:
   1. When parsing to D1, descriptorResult.getDependencies().isEmpty(), so doRecurse() will not be executed Therefore, args.skipper.cache() will not be executed. The D1 will not exist in winnerGAs in the end.
   2. When parsing D2 of the same layer, because there is no same GA in winnerGAs, D2 and its children dependencies ( G1 and H1) will be parsed.
   3. When resolving to G2 on the same layer as G1, because winnerGAs already has G1, the resolution of the children dependencies of G2 will be skipped, that is, H2 will not be resolved.
   Then, to the second stage, transformgraph:
   4. Because D1 has the same depth as D2, D1 wins, that is, D2 and its children are eliminated, including G1
   5. Because G1 was eliminated, G2 won.
   
   Finally, the final dependency tree obtained by BF strategy is as follows:
   ![image](https://user-images.githubusercontent.com/104960983/166883171-998a8891-01d3-4988-bf09-1c4e91e08a1b.png)
   But the dependency tree obtained by DF is as follows:
   ![image](https://user-images.githubusercontent.com/104960983/166883198-1988a846-e94f-45e1-ad6a-61d2d0feeb4a.png)
   
   That is, in the final generated dependency tree, BF has less children dependency of G2 than DF.
   
   
   
   
   Signed-off-by: hongbo.weihb <ho...@alibaba-inc.com>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] cstamas commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118784209

   Locally verified: took test doe and test resources from this PR (but NOT the FIX), and copied it to BF and DF UT. I expected BF to fail and DF to pass. 
   
   And that exactly happened:
   ```
   [INFO] Results:
   [INFO] 
   [ERROR] Failures: 
   [ERROR]   BfDependencyCollectorUseSkipTest>BfDependencyCollectorTest.testDescriptorDependenciesEmpty:601->BfDependencyCollectorTest.assertEqualSubtree:133->BfDependencyCollectorTest.assertEqualSubtree:163->BfDependencyCollectorTest.assertEqualSubtree:163->BfDependencyCollectorTest.assertEqualSubtree:163->BfDependencyCollectorTest.assertEqualSubtree:155 path: [gid:a:jar:ver (), gid:e:jar:ver (compile), gid:f:jar:ver (compile), gid:g:jar:2 (compile)], expected: [gid:h:jar:2 (compile)], actual: [] expected:<1> but was:<0>
   [INFO] 
   [ERROR] Tests run: 299, Failures: 1, Errors: 0, Skipped: 0
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] weibo1995 commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
weibo1995 commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1120330832

   > @weibo1995
   > 
   > Thanks for fixing! Are you evaluating the performance difference between BF and DF? Did you find any improvement when running projects in your company?
   
   For applications with compilation time greater than 10 minutes, the effect is very good.
   thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] michael-o commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118837058

   JIRA issue please 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] caiwei-ebay2 commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
caiwei-ebay2 commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1120353319

   @weibo1995 
   
   Really appreciate your feedback! This solution does help for enterprise projects and was inspired from one project in our company that would fail with OOM (20G memory +) when running mvn clean install, this means this solution also reduced memory cost.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] weibo1995 commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
weibo1995 commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118351584

   > @weibo1995 could you craft a project that produces different trees on current master? As we could add it as UT...
   
   OK, let me add UT, thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] michael-o commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118382980

   @weibo1995 Very interesting, thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] caiwei-ebay2 commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
caiwei-ebay2 commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1120336316

   @weibo1995 
   
   Really appreciate your feedback, could you please let me know how many performance improvement you've witnessed for your project? Maybe before, after.
   
   I'm actually the author of this patch (I'm unable to login with original caiwei-ebay account with 2FA, so using this caiwei-ebay2 account :) ), with projects in our company, there is 30% to 70% performance gain if projects take minutes to build.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] asfgit closed pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #172: Fix the problem that the dependency tree is different when DF and BF …
URL: https://github.com/apache/maven-resolver/pull/172


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] weibo1995 commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
weibo1995 commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1120347512

   > @weibo1995
   > 
   > Really appreciate your feedback, could you please let me know how many performance improvement you've witnessed for your project? Maybe before, after.
   > 
   > I'm actually the author of this patch (I'm unable to login with original caiwei-ebay account with 2FA, so using this caiwei-ebay2 account :) ), with projects in our company, there is 30% to 70% performance gain if projects take minutes to build.
   
   ---
   At present, 5 or 6 long tail applications have been piloted, and the compilation time can be reduced by half, that is, about 100% effect. Later, we will use BF for more applications, and then feed back and communicate.
   thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] cstamas commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118493360

   Note to myself: after this PR is merged, we should pull up the "common" tests from DfDependencyCollectorTest and BfDependencyCollectorTest as they should cover pretty much same stuff, leave in UT classes only the specific tests. For example, this new test should be pulled up, as both should produce "same result"!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] weibo1995 commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
weibo1995 commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118452685

   > @weibo1995 could you craft a project that produces different trees on current master? As we could add it as UT...
   
   https://github.com/apache/maven-resolver/pull/172/commits/586eaadf358dba607dd2be10ff3756b064aed20f
   
   thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] githubbot-eric commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
githubbot-eric commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1119531719

   @weibo1995 
   
   Thanks for fixing!
   Are you evaluating the performance difference between BF and DF? Did you find any improvement when running projects in your company? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-resolver] cstamas commented on pull request #172: Fix the problem that the dependency tree is different when DF and BF …

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #172:
URL: https://github.com/apache/maven-resolver/pull/172#issuecomment-1118313118

   @weibo1995 could you craft a project that produces different trees on current master? As we could add it as UT...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org