hvanhovell commented on code in PR #42184:
URL: https://github.com/apache/spark/pull/42184#discussion_r1277650985


##########
common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java:
##########
@@ -416,7 +416,7 @@ public void 
initializeApplication(ApplicationInitializationContext context) {
     String appId = context.getApplicationId().toString();
     try {
       ByteBuffer appServiceData = context.getApplicationDataForService();
-      String payload = JavaUtils.bytesToString(appServiceData);
+      String payload = JavaUtils.bytesToString(appServiceData.slice());

Review Comment:
   This was an actual bug, that it used to work was luck - the . The buffer is 
consumed twice, here and later on when we serialize the password. In that case 
the second serialization will read an exhausted buffer.



##########
common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java:
##########
@@ -416,7 +416,7 @@ public void 
initializeApplication(ApplicationInitializationContext context) {
     String appId = context.getApplicationId().toString();
     try {
       ByteBuffer appServiceData = context.getApplicationDataForService();
-      String payload = JavaUtils.bytesToString(appServiceData);
+      String payload = JavaUtils.bytesToString(appServiceData.slice());

Review Comment:
   This was an actual bug, that it used to work was luck. The buffer is 
consumed twice, here and later on when we serialize the password. In that case 
the second serialization will read an exhausted buffer.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to