-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
theme/apiHTTP API and SDK issuesHTTP API and SDK issuestheme/eventsIssues related to eventsIssues related to eventstype/bug
Description
Nomad version
Output from nomad version
nomad newtest version
Operating system and Environment details
golang
Issue
api Client EventStream; can not detect nomad server‘s disconnet,and reconnect to server automaticly
Reproduction steps
config := api.DefaultConfig()
config.Address = url
client, err := api.NewClient(config)
if err != nil {
return
}
defer client.Close()
topics := map[api.Topic][]string{
//api.TopicJob: {"*"},
api.TopicAllocation: {"*"},
}
ctx, _ := context.WithCancel(context.Background())
stream, err := client.EventStream().Stream(ctx, topics, 0, &api.QueryOptions{})
if err != nil {
}
for {
select {
case events, ok := <-stream:
if !ok {
log.Infof("stream close")
}
case <-ctx.Done():
log.Infof("Nomad Job stop")
}
}
1 use these code to connect to nomad server
2 close nomad server
3 can not detect nomd disconnect event
4 restart the nomad server
5 can not rec any event for ever
Expected Result
Actual Result
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
theme/apiHTTP API and SDK issuesHTTP API and SDK issuestheme/eventsIssues related to eventsIssues related to eventstype/bug
Type
Projects
Status
Done