Github user uncleGen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15915#discussion_r92103662
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/io/ChunkedByteBufferOutputStream.scala
 ---
    @@ -30,9 +31,14 @@ import org.apache.spark.storage.StorageUtils
      * @param chunkSize size of each chunk, in bytes.
      */
     private[spark] class ChunkedByteBufferOutputStream(
    -    chunkSize: Int,
    +    var chunkSize: Int,
         allocator: Int => ByteBuffer)
    -  extends OutputStream {
    +  extends OutputStream with Logging{
    +
    +  if (chunkSize < 0) {
    +    logWarning(s"chunkSize should not be an negative value, replaced as 
4MB default.")
    +    chunkSize = 4 * 1024 * 1024
    +  }
     
    --- End diff --
    
    As `chunkSize` is passed from many code path, and there is underlying 
integer overflow when convert from `Long` to `Int`. As we do not have a better 
solution, introducing a protection check may be a tradeoff way in the first 
step.
    
    @JoshRosen @srowen 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to