Skip to content

Commit

Permalink
Forcibly enable heap
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Dec 16, 2024
1 parent 2436f92 commit 23c7f2c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
38 changes: 19 additions & 19 deletions core/services/streams/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@ func (s *stream) Run(ctx context.Context) (run *pipeline.Run, trrs pipeline.Task
// Upon context cancellation, its expected that we return any usable values within ObservationGracePeriod.
func (s *stream) executeRun(ctx context.Context) (*pipeline.Run, pipeline.TaskRunResults, error) {
// the hot path here is to avoid parsing and use the pre-parsed, cached, pipeline
// s.RLock()
// initialize := s.spec.Pipeline == nil
// s.RUnlock()
// if initialize {
// pipeline, err := s.spec.ParsePipeline()
// if err != nil {
// return nil, nil, fmt.Errorf("Run failed due to unparseable pipeline: %w", err)
// }

// s.Lock()
// if s.spec.Pipeline == nil {
// s.spec.Pipeline = pipeline
// // initialize it for the given runner
// if _, err := s.runner.InitializePipeline(*s.spec); err != nil {
// return nil, nil, fmt.Errorf("Run failed due to error while initializing pipeline: %w", err)
// }
// }
// s.Unlock()
// }
s.RLock()
initialize := s.spec.Pipeline == nil
s.RUnlock()
if initialize {
pipeline, err := s.spec.ParsePipeline()
if err != nil {
return nil, nil, fmt.Errorf("Run failed due to unparseable pipeline: %w", err)
}

s.Lock()
if s.spec.Pipeline == nil {
s.spec.Pipeline = pipeline
// initialize it for the given runner
if _, err := s.runner.InitializePipeline(*s.spec); err != nil {
return nil, nil, fmt.Errorf("Run failed due to error while initializing pipeline: %w", err)
}
}
s.Unlock()
}

vars := pipeline.NewVarsFrom(map[string]interface{}{
"pipelineSpec": map[string]interface{}{
Expand Down
6 changes: 3 additions & 3 deletions core/web/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ func metricRoutes(r *gin.RouterGroup, includeHeap bool) {
pprofGroup.GET("/allocs", ginHandlerFromHTTP(pprof.Handler("allocs").ServeHTTP))
pprofGroup.GET("/block", ginHandlerFromHTTP(pprof.Handler("block").ServeHTTP))
pprofGroup.GET("/goroutine", ginHandlerFromHTTP(pprof.Handler("goroutine").ServeHTTP))
if includeHeap {
pprofGroup.GET("/heap", ginHandlerFromHTTP(pprof.Handler("heap").ServeHTTP))
}
// if includeHeap {
pprofGroup.GET("/heap", ginHandlerFromHTTP(pprof.Handler("heap").ServeHTTP))
// }
pprofGroup.GET("/mutex", ginHandlerFromHTTP(pprof.Handler("mutex").ServeHTTP))
pprofGroup.GET("/threadcreate", ginHandlerFromHTTP(pprof.Handler("threadcreate").ServeHTTP))
}
Expand Down

0 comments on commit 23c7f2c

Please sign in to comment.