Skip to content

Commit

Permalink
disable default pool behavior
Browse files Browse the repository at this point in the history
- disable default pool behavior to avoid unnecessary connection buildup
- improve connection management for source/target options
- TODO: refactor metadata passing for better connection management
  • Loading branch information
flarco committed Feb 1, 2025
1 parent 8468378 commit e18771a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions core/sling/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,17 @@ func (t *TaskExecution) setGetMetadata() (metadata iop.Metadata) {
}

func (t *TaskExecution) isUsingPool() bool {
if val := os.Getenv("SLING_POOL"); val != "" && !cast.ToBool(val) {
return false
if val := os.Getenv("SLING_POOL"); val != "" {
return cast.ToBool(val)
}
return cast.ToBool(os.Getenv("SLING_CLI")) && t.Config.ReplicationMode()
// return cast.ToBool(os.Getenv("SLING_CLI")) && t.Config.ReplicationMode()

// disabling pool by default connections are opened based on
// source/target options, causing opening new connections anyways
// this builds up the open connections for each stream.
// TODO: refactor the way source/target options and metadata are passed
// which is a big refactor.
return false
}

func (t *TaskExecution) getTargetObjectValue() string {
Expand Down

0 comments on commit e18771a

Please sign in to comment.