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
cdd1af56
Commit
cdd1af56
authored
11 years ago
by
Mark Hamstra
Browse files
Options
Downloads
Patches
Plain Diff
Timeout zombie workers
parent
e8bec836
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/deploy/master/Master.scala
+12
-6
12 additions, 6 deletions
core/src/main/scala/spark/deploy/master/Master.scala
with
12 additions
and
6 deletions
core/src/main/scala/spark/deploy/master/Master.scala
+
12
−
6
View file @
cdd1af56
...
@@ -39,7 +39,8 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
...
@@ -39,7 +39,8 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
val
DATE_FORMAT
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
)
// For application IDs
val
DATE_FORMAT
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
)
// For application IDs
val
WORKER_TIMEOUT
=
System
.
getProperty
(
"spark.worker.timeout"
,
"60"
).
toLong
*
1000
val
WORKER_TIMEOUT
=
System
.
getProperty
(
"spark.worker.timeout"
,
"60"
).
toLong
*
1000
val
RETAINED_APPLICATIONS
=
System
.
getProperty
(
"spark.deploy.retainedApplications"
,
"200"
).
toInt
val
RETAINED_APPLICATIONS
=
System
.
getProperty
(
"spark.deploy.retainedApplications"
,
"200"
).
toInt
val
REAPER_ITERATIONS
=
System
.
getProperty
(
"spark.dead.worker.persistence"
,
"15"
).
toInt
var
nextAppNumber
=
0
var
nextAppNumber
=
0
val
workers
=
new
HashSet
[
WorkerInfo
]
val
workers
=
new
HashSet
[
WorkerInfo
]
val
idToWorker
=
new
HashMap
[
String
,
WorkerInfo
]
val
idToWorker
=
new
HashMap
[
String
,
WorkerInfo
]
...
@@ -337,12 +338,17 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
...
@@ -337,12 +338,17 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
/** Check for, and remove, any timed-out workers */
/** Check for, and remove, any timed-out workers */
def
timeOutDeadWorkers
()
{
def
timeOutDeadWorkers
()
{
// Copy the workers into an array so we don't modify the hashset while iterating through it
// Copy the workers into an array so we don't modify the hashset while iterating through it
val
expiration
Time
=
System
.
currentTimeMillis
()
-
WORKER_TIMEOUT
val
current
Time
=
System
.
currentTimeMillis
()
val
toRemove
=
workers
.
filter
(
_
.
lastHeartbeat
<
expirationTime
).
toArray
val
toRemove
=
workers
.
filter
(
_
.
lastHeartbeat
<
currentTime
-
WORKER_TIMEOUT
).
toArray
for
(
worker
<-
toRemove
)
{
for
(
worker
<-
toRemove
)
{
logWarning
(
"Removing %s because we got no heartbeat in %d seconds"
.
format
(
if
(
worker
.
state
!=
WorkerState
.
DEAD
)
{
worker
.
id
,
WORKER_TIMEOUT
))
logWarning
(
"Removing %s because we got no heartbeat in %d seconds"
.
format
(
removeWorker
(
worker
)
worker
.
id
,
WORKER_TIMEOUT
))
removeWorker
(
worker
)
}
else
{
if
(
worker
.
lastHeartbeat
<
currentTime
-
((
REAPER_ITERATIONS
+
1
)
*
WORKER_TIMEOUT
))
workers
-=
worker
// we've seen this DEAD worker in the UI, etc. for long enough; cull it
}
}
}
}
}
}
}
...
...
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