Skip to content

Commit 4c1f073

Browse files
author
Reza Safi
committed
emove the unnecessary trywithresources
1 parent 805741c commit 4c1f073

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/main/scala/org/apache/spark/executor/ProcfsMetricsGetter.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private[spark] class ProcfsMetricsGetter(val procfsDir: String = "/proc/") exten
173173
Utils.tryWithResource(new InputStreamReader(
174174
new FileInputStream(
175175
new File(pidDir, procfsStatFile)), Charset.forName("UTF-8"))) { fReader =>
176-
Utils.tryWithResource( new BufferedReader(fReader)) { in =>
176+
val in = new BufferedReader(fReader)
177177
val procInfo = in.readLine
178178
val procInfoSplit = procInfo.split(" ")
179179
val vmem = procInfoSplit(22).toLong
@@ -196,7 +196,6 @@ private[spark] class ProcfsMetricsGetter(val procfsDir: String = "/proc/") exten
196196
otherRSSTotal = allMetrics.otherRSSTotal + (rssMem)
197197
)
198198
}
199-
}
200199
}
201200
} catch {
202201
case f: IOException =>

0 commit comments

Comments
 (0)