Skip to content

Commit

Permalink
[core] Make sure to output ODC details
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Jul 11, 2023
1 parent 7469605 commit 9f4448b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/integration/odc/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,19 @@ func (p *Plugin) queryPartitionStatus() {
if err != nil {
continue
}

wg.Add(1)

odcPartInfoSlice[idx] = &OdcPartitionInfo{
PartitionId: id,
RunNumber: uint32(odcPartSt.Runnr),
State: odcPartSt.State,
DdsSessionId: odcPartSt.Sessionid,
DdsSessionStatus: odcPartSt.Status.String(),
}
i := idx

go func(idx int, partId uid.ID) {
wg.Add(1)
defer wg.Done()

ctx, cancel := context.WithTimeout(context.Background(), ODC_STATUS_TIMEOUT)
Expand All @@ -200,12 +203,14 @@ func (p *Plugin) queryPartitionStatus() {
if err != nil {
log.WithField("level", infologger.IL_Support).
WithField("call", "GetState").
WithField("partition", partId.String()).
WithError(err).Error("ODC error")
return
}
if odcPartStateRep == nil || odcPartStateRep.Reply == nil {
log.WithField("level", infologger.IL_Support).
WithField("call", "GetState").
WithField("partition", partId.String()).
WithError(fmt.Errorf("ODC GetState response is nil")).Error("ODC error")
return
}
Expand All @@ -221,8 +226,7 @@ func (p *Plugin) queryPartitionStatus() {
Host: device.Host,
}
}

}(idx, id)
}(i, id)
}
wg.Wait()

Expand Down

0 comments on commit 9f4448b

Please sign in to comment.