viirya opened a new pull request #24521: [SPARK-27629][PySpark] Prevent 
Unpickler from intervening each unpickling
URL: https://github.com/apache/spark/pull/24521
 
 
   ## What changes were proposed in this pull request?
   
   In SPARK-27612, one correctness issue was reported. When protocol 4 is used 
to pickle Python objects, we found that unpickled objects were wrong. A 
temporary fix was proposed by not using highest protocol.
   
   It was found that Opcodes.MEMOIZE was appeared in the opcodes in protocol 4. 
It is suspect to this issue.
   
   A deeper dive found that Opcodes.MEMOIZE stores objects into internal map of 
Unpickler object. We use single Unpickler object to unpickle serialized Python 
bytes. Stored objects intervenes next round of unpickling, if the map is not 
cleared.
   
   We has two options:
   
   1. Continues to reuse Unpickler, but calls its close after each unpickling.
   2. Not to reuse Unpickler and create new Unpickler object in each unpickling.
   
   This patch takes option 1.
   
   ## How was this patch tested?
   
   Passing the test added in SPARK-27612.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to