Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fb781bea
Commit
fb781bea
authored
Apr 09, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6623 from wojtek-t/fix_scheduler_profiling
Fix scheduler crashes when profiling is enabled
parents
ca6f1a1b
51a2d2db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
server.go
plugin/cmd/kube-scheduler/app/server.go
+12
-6
No files found.
plugin/cmd/kube-scheduler/app/server.go
View file @
fb781bea
...
@@ -69,7 +69,7 @@ func (s *SchedulerServer) AddFlags(fs *pflag.FlagSet) {
...
@@ -69,7 +69,7 @@ func (s *SchedulerServer) AddFlags(fs *pflag.FlagSet) {
client
.
BindClientConfigFlags
(
fs
,
&
s
.
ClientConfig
)
client
.
BindClientConfigFlags
(
fs
,
&
s
.
ClientConfig
)
fs
.
StringVar
(
&
s
.
AlgorithmProvider
,
"algorithm_provider"
,
s
.
AlgorithmProvider
,
"The scheduling algorithm provider to use"
)
fs
.
StringVar
(
&
s
.
AlgorithmProvider
,
"algorithm_provider"
,
s
.
AlgorithmProvider
,
"The scheduling algorithm provider to use"
)
fs
.
StringVar
(
&
s
.
PolicyConfigFile
,
"policy_config_file"
,
s
.
PolicyConfigFile
,
"File with scheduler policy configuration"
)
fs
.
StringVar
(
&
s
.
PolicyConfigFile
,
"policy_config_file"
,
s
.
PolicyConfigFile
,
"File with scheduler policy configuration"
)
fs
.
BoolVar
(
&
s
.
EnableProfiling
,
"profiling"
,
fals
e
,
"Enable profiling via web interface host:port/debug/pprof/"
)
fs
.
BoolVar
(
&
s
.
EnableProfiling
,
"profiling"
,
tru
e
,
"Enable profiling via web interface host:port/debug/pprof/"
)
}
}
// Run runs the specified SchedulerServer. This should never exit.
// Run runs the specified SchedulerServer. This should never exit.
...
@@ -80,13 +80,19 @@ func (s *SchedulerServer) Run(_ []string) error {
...
@@ -80,13 +80,19 @@ func (s *SchedulerServer) Run(_ []string) error {
}
}
go
func
()
{
go
func
()
{
mux
:=
http
.
NewServeMux
()
if
s
.
EnableProfiling
{
if
s
.
EnableProfiling
{
http
.
HandleFunc
(
"/debug/pprof/"
,
pprof
.
Index
)
mux
.
HandleFunc
(
"/debug/pprof/"
,
pprof
.
Index
)
http
.
HandleFunc
(
"/debug/pprof/profile"
,
pprof
.
Profile
)
mux
.
HandleFunc
(
"/debug/pprof/profile"
,
pprof
.
Profile
)
http
.
HandleFunc
(
"/debug/pprof/symbol"
,
pprof
.
Symbol
)
mux
.
HandleFunc
(
"/debug/pprof/symbol"
,
pprof
.
Symbol
)
}
}
http
.
Handle
(
"/metrics"
,
prometheus
.
Handler
())
mux
.
Handle
(
"/metrics"
,
prometheus
.
Handler
())
http
.
ListenAndServe
(
net
.
JoinHostPort
(
s
.
Address
.
String
(),
strconv
.
Itoa
(
s
.
Port
)),
nil
)
server
:=
&
http
.
Server
{
Addr
:
net
.
JoinHostPort
(
s
.
Address
.
String
(),
strconv
.
Itoa
(
s
.
Port
)),
Handler
:
mux
,
}
glog
.
Fatal
(
server
.
ListenAndServe
())
}()
}()
configFactory
:=
factory
.
NewConfigFactory
(
kubeClient
)
configFactory
:=
factory
.
NewConfigFactory
(
kubeClient
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment