Browse Source

fix bug that prevented publishing twice to the same path (#1470) (#1469)

pull/1476/head v0.21.4
aler9 4 years ago
parent
commit
f1455a6e1f
  1. 5
      internal/core/path.go
  2. 6
      internal/core/path_manager.go

5
internal/core/path.go

@ -510,6 +510,9 @@ func (pa *path) run() {
} }
}() }()
// call before destroying context
pa.parent.onPathClose(pa)
pa.ctxCancel() pa.ctxCancel()
pa.onDemandStaticSourceReadyTimer.Stop() pa.onDemandStaticSourceReadyTimer.Stop()
@ -548,8 +551,6 @@ func (pa *path) run() {
} }
pa.log(logger.Debug, "destroyed (%v)", err) pa.log(logger.Debug, "destroyed (%v)", err)
pa.parent.onPathClose(pa)
} }
func (pa *path) shouldClose() bool { func (pa *path) shouldClose() bool {

6
internal/core/path_manager.go

@ -364,7 +364,7 @@ func (pm *pathManager) pathSourceReady(pa *path) {
select { select {
case pm.chPathSourceReady <- pa: case pm.chPathSourceReady <- pa:
case <-pm.ctx.Done(): 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()
} }
} }
@ -373,7 +373,7 @@ func (pm *pathManager) pathSourceNotReady(pa *path) {
select { select {
case pm.chPathSourceNotReady <- pa: case pm.chPathSourceNotReady <- pa:
case <-pm.ctx.Done(): 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()
} }
} }
@ -382,7 +382,7 @@ func (pm *pathManager) onPathClose(pa *path) {
select { select {
case pm.chPathClose <- pa: case pm.chPathClose <- pa:
case <-pm.ctx.Done(): 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()
} }
} }

Loading…
Cancel
Save