[GitHub] spark pull request #18324: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2018-06-21 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18324#discussion_r197355680
  
--- Diff: python/pyspark/worker.py ---
@@ -177,8 +180,11 @@ def process():
 process()
 except Exception:
 try:
+exc_info = traceback.format_exc()
+if isinstance(exc_info, unicode):
+exc_info = exc_info.encode('utf-8')
--- End diff --

cc @jiangxb1987 


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18324: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-11-30 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18324#discussion_r154274837
  
--- Diff: python/pyspark/worker.py ---
@@ -177,8 +180,11 @@ def process():
 process()
 except Exception:
 try:
+exc_info = traceback.format_exc()
+if isinstance(exc_info, unicode):
+exc_info = exc_info.encode('utf-8')
--- End diff --

@HyukjinKwon this pr can only be hanging?


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18324: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-20 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18324#discussion_r122934275
  
--- Diff: python/pyspark/worker.py ---
@@ -177,8 +180,11 @@ def process():
 process()
 except Exception:
 try:
+exc_info = traceback.format_exc()
+if isinstance(exc_info, unicode):
+exc_info = exc_info.encode('utf-8')
--- End diff --

@HyukjinKwon @ueshin what need I do next?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18324: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-18 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18324#discussion_r122612674
  
--- Diff: python/pyspark/tests.py ---
@@ -1859,6 +1860,31 @@ def test_with_different_versions_of_python(self):
 finally:
 self.sc.pythonVer = version
 
+def test_exception_blocking(self):
+"""
+SPARK-21045
+Test whether program is blocked when occur exception in worker 
sending
+exception to PythonRDD
+
+"""
+import threading
+
+def run():
+try:
+
+def f():
+raise Exception("中")
+
+self.sc.parallelize([1]).map(lambda x: f()).count()
+except Exception:
+pass
+
+t = threading.Thread(target=run)
--- End diff --

This test mainly check whether it is blocked. So I use thread join, if it 
is blocked before fixing the bug the program will wait 10s and exit instead 
blocking other tests.



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark issue #18324: [SPARK-21045][PYSPARK]Fixed executor blocked because tra...

2017-06-15 Thread dataknocker
Github user dataknocker commented on the issue:

https://github.com/apache/spark/pull/18324
  
@HyukjinKwon pr 18262 have some problems. So I add this new pr.
I have add my test for this change.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark issue #18262: [SPARK-21045][PYSPARK]Fixed executor blocked because tra...

2017-06-15 Thread dataknocker
Github user dataknocker commented on the issue:

https://github.com/apache/spark/pull/18262
  
Some thing wrong, so I close this pr and add new pr 
[#18324](https://github.com/apache/spark/pull/18324)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18324: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-15 Thread dataknocker
GitHub user dataknocker opened a pull request:

https://github.com/apache/spark/pull/18324

[SPARK-21045][PYSPARK]Fixed executor blocked because traceback.format_exc 
throw UnicodeDecodeError

## What changes were proposed in this pull request?

check if traceback.format_exc() is unicode then encode utf8.

## How was this patch tested?

We can run in pyspark:
```python
def f():
raise Exception("中")
spark = SparkSession.builder.master('local').getOrCreate()
spark.sparkContext.parallelize([1]).map(lambda x: f()).count()
```

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

And I have added the test to pyspark.tests.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dataknocker/spark SPARK-21045

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/18324.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #18324


commit 6cbc3f70f35b24dfef71771ab64f300f86faf325
Author: wangzejie 
Date:   2017-06-16T06:49:37Z

Fixed executor blocked because traceback.format_exc encode utf8 throw 
UnicodeDecodeError




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18262: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-15 Thread dataknocker
Github user dataknocker closed the pull request at:

https://github.com/apache/spark/pull/18262


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark issue #18262: [SPARK-21045][PYSPARK]Fixed executor blocked because tra...

2017-06-13 Thread dataknocker
Github user dataknocker commented on the issue:

https://github.com/apache/spark/pull/18262
  
@HyukjinKwon ok, I will add my test later.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18262: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-13 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18262#discussion_r121599465
  
--- Diff: python/pyspark/worker.py ---
@@ -177,8 +177,13 @@ def process():
 process()
 except Exception:
 try:
+exc_info = traceback.format_exc()
+try:
+exc_info = exc_info.encode("utf-8")
--- End diff --

Benefit a lot, thx.

exc_info = exc_info.str(desc)is right? I think I can remove it.

```python
if sys.version >= '3':
unicode = str
if isinstance(exc_info, unicode):
exc_info = exc_info.encode('utf-8'))

```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18262: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-12 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18262#discussion_r121590988
  
--- Diff: python/pyspark/worker.py ---
@@ -177,8 +177,13 @@ def process():
 process()
 except Exception:
 try:
+exc_info = traceback.format_exc()
+try:
+exc_info = exc_info.encode("utf-8")
--- End diff --

In Python 2, traceback.format_exc() is already str, don't need to encode. 
So can I change like this:


exc_info = traceback.format_exc()
if sys.version > '3':
exc_info = exc_info.encode("utf-8")
write_int(SpecialLengths.PYTHON_EXCEPTION_THROWN, outfile)
write_with_length(exc_info, outfile)




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18261: [SPARK-21045][PYSPARK] Fixed executor blocked bec...

2017-06-12 Thread dataknocker
Github user dataknocker closed the pull request at:

https://github.com/apache/spark/pull/18261


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18261: [SPARK-21045][PYSPARK] Fixed executor blocked bec...

2017-06-12 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18261#discussion_r121579335
  
--- Diff: python/pyspark/worker.py ---
@@ -178,7 +178,7 @@ def process():
 except Exception:
 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)
--- End diff --

It slove problem in Python 2 but cause blocked in Python 3.
I have new pr in [#18262](https://github.com/apache/spark/pull/18262) used 
try except.
I will close this pr.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18261: [SPARK-21045][PYSPARK] Fixed executor blocked bec...

2017-06-12 Thread dataknocker
Github user dataknocker commented on a diff in the pull request:

https://github.com/apache/spark/pull/18261#discussion_r121578044
  
--- Diff: python/pyspark/worker.py ---
@@ -178,7 +178,7 @@ def process():
 except Exception:
 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)
--- End diff --

Yes, It can work with Python2 and 3+.
In Python 3+,  has encode("utf-8") or not is all ok.
In Python 2, should remove encode("utf-8"). 
Or we can use try except to slove it like 
[#18262](https://github.com/apache/spark/pull/18262)



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark issue #18262: [SPARK-21045][PYSPARK]Fixed executor blocked because tra...

2017-06-10 Thread dataknocker
Github user dataknocker commented on the issue:

https://github.com/apache/spark/pull/18262
  
We can choose one pr in this and 
[#18261](https://github.com/apache/spark/pull/18261) to slove SPARK-21045


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18262: [SPARK-21045][PYSPARK]Fixed executor blocked beca...

2017-06-10 Thread dataknocker
GitHub user dataknocker opened a pull request:

https://github.com/apache/spark/pull/18262

[SPARK-21045][PYSPARK]Fixed executor blocked because traceback.format_exc 
throw UnicodeDecodeError

## What changes were proposed in this pull request?

when encode throw exception, use origin exception info.

## 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.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dataknocker/spark SPARK-21045-2

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/18262.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #18262


commit 81f5db5c756739d2b5b8ee3e9077ef8e742c7179
Author: wangzejie 
Date:   2017-06-10T16:29:11Z

Fixed executor blocked because traceback.format_exc throw UnicodeDecodeError




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #18261: [SPARK-21045][PySpark] Fixed executor blocked bec...

2017-06-10 Thread dataknocker
GitHub user dataknocker opened a pull request:

https://github.com/apache/spark/pull/18261

[SPARK-21045][PySpark] Fixed executor blocked because of 
traceback.format_exc throw UnicodeD…

…ecodeError

## 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.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/dataknocker/spark SPARK-21045

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/18261.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #18261


commit f65a000f2db72106b2bcaa5f8e84717b0a9700c5
Author: wangzejie 
Date:   2017-06-10T15:46:58Z

Fixed executor blocked because of traceback.format_exc throw 
UnicodeDecodeError




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org