Skip to content

Conversation

@dataknocker
Copy link

@dataknocker dataknocker commented Jun 10, 2017

What changes were proposed in this pull request?

remove encode utf8 to traceback.format_exc()

How was this patch tested?

We can run in pyspark:
spark = SparkSession.builder.master('local').getOrCreate()
rdd = spark.sparkContext.parallelize(['中']).map(lambda x: x.encode("utf8"))
rdd.count()

Before fixed this bug, this program will be blocked.
After fixed this bug, this program will throw exception expected.

@dataknocker dataknocker changed the title [SPARK-21045][PySpark] Fixed executor blocked because of traceback.format_exc throw UnicodeD… [SPARK-21045][PYSPARK] Fixed executor blocked because of traceback.format_exc throw UnicodeD… Jun 10, 2017
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

try:
write_int(SpecialLengths.PYTHON_EXCEPTION_THROWN, outfile)
write_with_length(traceback.format_exc().encode("utf-8"), outfile)
write_with_length(traceback.format_exc(), outfile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with Python2 and 3+?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It slove problem in Python 2 but cause blocked in Python 3.
I have new pr in #18262 used try except.
I will close this pr.

@dataknocker dataknocker changed the title [SPARK-21045][PYSPARK] Fixed executor blocked because of traceback.format_exc throw UnicodeD… [SPARK-21045][PYSPARK] Fixed executor blocked because of traceback.format_exc throw UnicodeDecodeError Jun 13, 2017
@dataknocker dataknocker deleted the SPARK-21045 branch June 16, 2017 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants