@@ -111,10 +111,8 @@ func (reportMgr *ReportManager) SendReport(tb *TelemetryBuffer) error {
111111 if tb != nil && tb .Connected {
112112 report , err = reportMgr .ReportToBytes ()
113113 if err == nil {
114- // If write fails, try to re-establish connections as server/client
115114 if _ , err = tb .Write (report ); err != nil {
116115 log .Printf ("telemetry write failed:%v" , err )
117- tb .Cancel ()
118116 }
119117 }
120118 }
@@ -124,7 +122,6 @@ func (reportMgr *ReportManager) SendReport(tb *TelemetryBuffer) error {
124122
125123// ReportToBytes - returns the report bytes
126124func (reportMgr * ReportManager ) ReportToBytes () ([]byte , error ) {
127-
128125 switch reportMgr .Report .(type ) {
129126 case * CNIReport :
130127 case * AIMetric :
@@ -145,9 +142,8 @@ func SendCNIMetric(cniMetric *AIMetric, tb *TelemetryBuffer) error {
145142 reportMgr := & ReportManager {Report : cniMetric }
146143 report , err = reportMgr .ReportToBytes ()
147144 if err == nil {
148- // If write fails, try to re-establish connections as server/client
149145 if _ , err = tb .Write (report ); err != nil {
150- tb . Cancel ( )
146+ log . Printf ( "Error writing to telemetry socket:%v" , err )
151147 }
152148 }
153149 }
@@ -160,10 +156,8 @@ func SendCNIEvent(tb *TelemetryBuffer, report *CNIReport) {
160156 reportMgr := & ReportManager {Report : report }
161157 reportBytes , err := reportMgr .ReportToBytes ()
162158 if err == nil {
163- // If write fails, try to re-establish connections as server/client
164159 if _ , err = tb .Write (reportBytes ); err != nil {
165160 log .Printf ("Error writing to telemetry socket:%v" , err )
166- tb .Cancel ()
167161 }
168162 }
169163 }
0 commit comments