You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "igor-dv (via GitHub)" <gi...@apache.org> on 2026/10/05 11:07:22 UTC
[I] [Bug]: Go harness can deadlock when recreating a data/state channel [beam]
igor-dv opened a new issue, #40414:
URL: https://github.com/apache/beam/issues/40414
### What happened?
`DataChannelManager.closeInstruction` takes the manager lock
```go
func (m *DataChannelManager) closeInstruction(...) {
m.mu.Lock()
defer m.mu.Unlock()
...
err := ch.removeInstruction(instID)
}
```
Then `ch.removeInstruction(instID)` takes the channel lock:
```go
func (c *DataChannel) removeInstruction(...) {
c.mu.Lock()
...
}
```
If the stream fails (DataChannel.read):
```go
c.mu.Lock()
c.terminateStreamOnError(err) // requires the lock to be held
c.mu.Unlock()
```
terminateStreamOnError (still under that lock) calls the callback:
```go
func (c *DataChannel) terminateStreamOnError(err error) {
...
if c.forceRecreate != nil {
c.forceRecreate(c.id, err)
c.forceRecreate = nil
}
}
```
That callback is the one Open set, and that is where the manager lock is taken:
```go
ch.forceRecreate = func(id string, err error) {
....
m.mu.Lock()
delete(m.ports, port.URL)
m.mu.Unlock()
}
```
**So one thread is: c.mu → m.mu. The other (closeInstruction) is: m.mu → c.mu.**
I would like forceRecreate to drop the port after releasing the channel lock, and only if this channel is still the one in the map (so a replacement from Open is not deleted).
(Same problem with the StateChannel)
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [ ] Component: Java SDK
- [x] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Infrastructure
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Prism Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Go harness can deadlock when recreating a data/state channel [beam]
Posted by "jrmccluskey (via GitHub)" <gi...@apache.org>.
jrmccluskey closed issue #40414: [Bug]: Go harness can deadlock when recreating a data/state channel
URL: https://github.com/apache/beam/issues/40414
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Go harness can deadlock when recreating a data/state channel [beam]
Posted by "igor-dv (via GitHub)" <gi...@apache.org>.
igor-dv commented on issue #40414:
URL: https://github.com/apache/beam/issues/40414#issuecomment-5993211735
.take-issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org