Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-23345][SQL] Remove open stream record even closing it fails #20524

Closed
wants to merge 2 commits into from

Conversation

viirya
Copy link
Member

@viirya viirya commented Feb 7, 2018

What changes were proposed in this pull request?

When DebugFilesystem closes opened stream, if any exception occurs, we still need to remove the open stream record from DebugFilesystem. Otherwise, it goes to report leaked filesystem connection.

How was this patch tested?

Existing tests.

@viirya
Copy link
Member Author

viirya commented Feb 7, 2018

cc @cloud-fan @vanzin

@cloud-fan
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Feb 7, 2018

Test build #87147 has finished for PR 20524 at commit 34df0cd.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Feb 7, 2018

Test build #87150 has finished for PR 20524 at commit 34df0cd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@viirya
Copy link
Member Author

viirya commented Feb 7, 2018

retest this please.

@@ -111,7 +111,7 @@ trait SharedSparkSession
spark.sharedState.cacheManager.clearCache()
// files can be closed from other threads, so wait a bit
// normally this doesn't take more than 1s
eventually(timeout(10.seconds)) {
eventually(timeout(10.seconds), interval(2.seconds)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the problem if interval is small?

Copy link
Member Author

Choose a reason for hiding this comment

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

assertNoOpenStreams and removeOpenStream are both synchronized on openStreams map. I want to increase interval to prevent starvation for removeOpenStream.

Copy link
Member

Choose a reason for hiding this comment

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

The default is 15 milliseconds. It should be fine.

But, I am also fine to change this to 2 seconds. I checked the test history and this does not increase the testing time.

@SparkQA
Copy link

SparkQA commented Feb 7, 2018

Test build #87155 has finished for PR 20524 at commit 34df0cd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 7, 2018

Test build #87156 has finished for PR 20524 at commit 37024fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 7, 2018

Test build #87157 has finished for PR 20524 at commit 37024fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Feb 7, 2018
## What changes were proposed in this pull request?

When `DebugFilesystem` closes opened stream, if any exception occurs, we still need to remove the open stream record from `DebugFilesystem`. Otherwise, it goes to report leaked filesystem connection.

## How was this patch tested?

Existing tests.

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #20524 from viirya/SPARK-23345.

(cherry picked from commit 9841ae0)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
@asfgit asfgit closed this in 9841ae0 Feb 7, 2018
@gatorsmile
Copy link
Member

LGTM Thanks! Merged to master/2.3

robert3005 pushed a commit to palantir/spark that referenced this pull request Feb 12, 2018
## What changes were proposed in this pull request?

When `DebugFilesystem` closes opened stream, if any exception occurs, we still need to remove the open stream record from `DebugFilesystem`. Otherwise, it goes to report leaked filesystem connection.

## How was this patch tested?

Existing tests.

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes apache#20524 from viirya/SPARK-23345.
@viirya viirya deleted the SPARK-23345 branch December 27, 2023 18:21
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.

5 participants