Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
cf52d9ca
Commit
cf52d9ca
authored
12 years ago
by
Josh Rosen
Browse files
Options
Downloads
Patches
Plain Diff
Add try-finally to handle MapOutputTracker timeouts.
parent
8fd374df
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/spark/MapOutputTracker.scala
+17
-12
17 additions, 12 deletions
core/src/main/scala/spark/MapOutputTracker.scala
with
17 additions
and
12 deletions
core/src/main/scala/spark/MapOutputTracker.scala
+
17
−
12
View file @
cf52d9ca
...
...
@@ -148,18 +148,23 @@ private[spark] class MapOutputTracker(actorSystem: ActorSystem, isMaster: Boolea
// We won the race to fetch the output locs; do so
logInfo
(
"Doing the fetch; tracker actor = "
+
trackerActor
)
val
host
=
System
.
getProperty
(
"spark.hostname"
,
Utils
.
localHostName
)
val
fetchedBytes
=
askTracker
(
GetMapOutputStatuses
(
shuffleId
,
host
)).
asInstanceOf
[
Array
[
Byte
]]
val
fetchedStatuses
=
deserializeStatuses
(
fetchedBytes
)
logInfo
(
"Got the output locations"
)
mapStatuses
.
put
(
shuffleId
,
fetchedStatuses
)
fetching
.
synchronized
{
fetching
-=
shuffleId
fetching
.
notifyAll
()
}
if
(
fetchedStatuses
.
contains
(
null
))
{
throw
new
FetchFailedException
(
null
,
shuffleId
,
-
1
,
reduceId
,
new
Exception
(
"Missing an output location for shuffle "
+
shuffleId
))
// This try-finally prevents hangs due to timeouts:
var
fetchedStatuses
:
Array
[
MapStatus
]
=
null
try
{
val
fetchedBytes
=
askTracker
(
GetMapOutputStatuses
(
shuffleId
,
host
)).
asInstanceOf
[
Array
[
Byte
]]
fetchedStatuses
=
deserializeStatuses
(
fetchedBytes
)
logInfo
(
"Got the output locations"
)
mapStatuses
.
put
(
shuffleId
,
fetchedStatuses
)
if
(
fetchedStatuses
.
contains
(
null
))
{
throw
new
FetchFailedException
(
null
,
shuffleId
,
-
1
,
reduceId
,
new
Exception
(
"Missing an output location for shuffle "
+
shuffleId
))
}
}
finally
{
fetching
.
synchronized
{
fetching
-=
shuffleId
fetching
.
notifyAll
()
}
}
return
fetchedStatuses
.
map
(
s
=>
(
s
.
address
,
MapOutputTracker
.
decompressSize
(
s
.
compressedSizes
(
reduceId
))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment