-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
Describe the bug
Method amqp.Connection.Channel() is infinity blocked when internet turned off in the middle of DialConfig() and Channel():
config := amqp.Config{Properties: amqp.NewConnectionProperties()}
config.Properties.SetClientConnectionName(connName)
config.Heartbeat = 10 * time.Second
log.Debug().Msgf("dialing %q", amqpURI)
conn, err := amqp.DialConfig(amqpURI, config)
if err != nil {
return nil, fmt.Errorf("Dial: %s", err)
}
// turn off internet here
log.Debug().Msgf("turn off Internet!")
time.Sleep(10 * time.Second)
log.Debug().Msgf("got Connection")
channel, err := conn.Channel() // infinity blocked while no internet
if err != nil {
return nil, fmt.Errorf("Channel: %s", err)
}
Reproduction steps
- Dial to rabbitmq server and get Connection
- Turn off internet
- Call Connection.Channel() method
Expected behavior
Channel() method should return error after timeout.
Additional context
No response
shendongyuxmxm, philippreston and Pugnatoroneumyvakin
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working