Skip to content

Commit

Permalink
fix bug that prevented publishing twice to the same path (#1470) (#1469)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Feb 14, 2023
1 parent 19b06f9 commit f1455a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions internal/core/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ func (pa *path) run() {
}
}()

// call before destroying context
pa.parent.onPathClose(pa)

pa.ctxCancel()

pa.onDemandStaticSourceReadyTimer.Stop()
Expand Down Expand Up @@ -548,8 +551,6 @@ func (pa *path) run() {
}

pa.log(logger.Debug, "destroyed (%v)", err)

pa.parent.onPathClose(pa)
}

func (pa *path) shouldClose() bool {
Expand Down
6 changes: 3 additions & 3 deletions internal/core/path_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func (pm *pathManager) pathSourceReady(pa *path) {
select {
case pm.chPathSourceReady <- pa:
case <-pm.ctx.Done():
case <-pa.ctx.Done(): // in case pathManager is closing the path
case <-pa.ctx.Done(): // in case pathManager is blocked by path.wait()
}
}

Expand All @@ -373,7 +373,7 @@ func (pm *pathManager) pathSourceNotReady(pa *path) {
select {
case pm.chPathSourceNotReady <- pa:
case <-pm.ctx.Done():
case <-pa.ctx.Done(): // in case pathManager is closing the path
case <-pa.ctx.Done(): // in case pathManager is blocked by path.wait()
}
}

Expand All @@ -382,7 +382,7 @@ func (pm *pathManager) onPathClose(pa *path) {
select {
case pm.chPathClose <- pa:
case <-pm.ctx.Done():
case <-pa.ctx.Done(): // in case pathManager is closing the path
case <-pa.ctx.Done(): // in case pathManager is blocked by path.wait()
}
}

Expand Down

0 comments on commit f1455a6

Please sign in to comment.