Skip to content

Commit 8c177bb

Browse files
authored
Merge pull request #773 from openziti/close-tweaks
xgress close tweaks. Fixes #772
2 parents 9b0e8a9 + 861f859 commit 8c177bb

File tree

14 files changed

+41
-20
lines changed

14 files changed

+41
-20
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Release notes 1.2.1
2+
3+
## Issues Fixed and Dependency Updates
4+
5+
* github.com/openziti/sdk-golang: [v1.2.0 -> v1.2.1](https://github.com/openziti/sdk-golang/compare/v1.2.0...v1.2.1)
6+
* [Issue #772](https://github.com/openziti/sdk-golang/issues/772) - xgress close tweaks
7+
* [Issue #769](https://github.com/openziti/sdk-golang/issues/769) - Require sdk flow control when using more than one default connection
8+
9+
* github.com/openziti/channel/v4: [v4.2.16 -> v4.2.18](https://github.com/openziti/channel/compare/v4.2.16...v4.2.18)
10+
* [Issue #201](https://github.com/openziti/channel/issues/201) - SendAndWait methods should return an error if the channel closes instead of blocking
11+
* [Issue #199](https://github.com/openziti/channel/issues/199) - Reject multi-underlay connections that are the first connection for a channel, but aren't marked as such.
12+
113
# Release notes 1.2.0
214

315
## What's New

example/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ require (
8181
github.com/muhlemmer/gu v0.3.1 // indirect
8282
github.com/oklog/ulid v1.3.1 // indirect
8383
github.com/opentracing/opentracing-go v1.2.0 // indirect
84-
github.com/openziti/channel/v4 v4.2.16 // indirect
84+
github.com/openziti/channel/v4 v4.2.18 // indirect
8585
github.com/openziti/edge-api v0.26.46 // indirect
8686
github.com/openziti/identity v1.0.109 // indirect
8787
github.com/openziti/metrics v1.4.2 // indirect

example/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
364364
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
365365
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
366366
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
367-
github.com/openziti/channel/v4 v4.2.16 h1:xOV9gkXBN8d4X4FFeguELTZtnpeRoApu09PAMTsDQZg=
368-
github.com/openziti/channel/v4 v4.2.16/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU=
367+
github.com/openziti/channel/v4 v4.2.18 h1:RuyB26/p+3L3BCtTB7tUH3O0KwfkRXeeVc2fEN9WU1c=
368+
github.com/openziti/channel/v4 v4.2.18/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU=
369369
github.com/openziti/edge-api v0.26.46 h1:cFOGXTIMXmxTgcM/bGd50OqZES/yT37MriojGJxozzo=
370370
github.com/openziti/edge-api v0.26.46/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
371371
github.com/openziti/foundation/v2 v2.0.70 h1:1g4jIl7nIdqW8oCgRcwlbNvK8dwk4mPyrwjjtjH1tp8=

example/influxdb-client-go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ require (
9494
github.com/muhlemmer/gu v0.3.1 // indirect
9595
github.com/oklog/ulid v1.3.1 // indirect
9696
github.com/opentracing/opentracing-go v1.2.0 // indirect
97-
github.com/openziti/channel/v4 v4.2.16 // indirect
97+
github.com/openziti/channel/v4 v4.2.18 // indirect
9898
github.com/openziti/edge-api v0.26.46 // indirect
9999
github.com/openziti/foundation/v2 v2.0.70 // indirect
100100
github.com/openziti/identity v1.0.109 // indirect

example/influxdb-client-go/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
418418
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
419419
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
420420
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
421-
github.com/openziti/channel/v4 v4.2.16 h1:xOV9gkXBN8d4X4FFeguELTZtnpeRoApu09PAMTsDQZg=
422-
github.com/openziti/channel/v4 v4.2.16/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU=
421+
github.com/openziti/channel/v4 v4.2.18 h1:RuyB26/p+3L3BCtTB7tUH3O0KwfkRXeeVc2fEN9WU1c=
422+
github.com/openziti/channel/v4 v4.2.18/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU=
423423
github.com/openziti/edge-api v0.26.46 h1:cFOGXTIMXmxTgcM/bGd50OqZES/yT37MriojGJxozzo=
424424
github.com/openziti/edge-api v0.26.46/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
425425
github.com/openziti/foundation/v2 v2.0.70 h1:1g4jIl7nIdqW8oCgRcwlbNvK8dwk4mPyrwjjtjH1tp8=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/michaelquigley/pfxlog v0.6.10
1919
github.com/mitchellh/go-ps v1.0.0
2020
github.com/mitchellh/mapstructure v1.5.0
21-
github.com/openziti/channel/v4 v4.2.16
21+
github.com/openziti/channel/v4 v4.2.18
2222
github.com/openziti/edge-api v0.26.46
2323
github.com/openziti/foundation/v2 v2.0.70
2424
github.com/openziti/identity v1.0.109

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak=
303303
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
304304
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
305305
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
306-
github.com/openziti/channel/v4 v4.2.16 h1:xOV9gkXBN8d4X4FFeguELTZtnpeRoApu09PAMTsDQZg=
307-
github.com/openziti/channel/v4 v4.2.16/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU=
306+
github.com/openziti/channel/v4 v4.2.18 h1:RuyB26/p+3L3BCtTB7tUH3O0KwfkRXeeVc2fEN9WU1c=
307+
github.com/openziti/channel/v4 v4.2.18/go.mod h1:v8AOCXLqE++BHGmDK7Ut8Uc2nCGyOu9hjkJNoWgpcyU=
308308
github.com/openziti/edge-api v0.26.46 h1:cFOGXTIMXmxTgcM/bGd50OqZES/yT37MriojGJxozzo=
309309
github.com/openziti/edge-api v0.26.46/go.mod h1:sYHVpm26Jr1u7VooNJzTb2b2nGSlmCHMnbGC8XfWSng=
310310
github.com/openziti/foundation/v2 v2.0.70 h1:1g4jIl7nIdqW8oCgRcwlbNvK8dwk4mPyrwjjtjH1tp8=

xgress/retransmitter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ func (self *Retransmitter) retransmitSender() {
145145
if !retransmit.isAcked() {
146146
retransmit.payload.MarkAsRetransmit()
147147
if err := retransmit.x.dataPlane.RetransmitPayload(retransmit.x.address, retransmit.payload); err != nil {
148-
// if xgress is closed, don't log the error. We still want to try retransmitting in case we're re-sending end of circuit
149-
if !retransmit.x.Closed() {
148+
// if xgress payload buffer is closed, don't log the error
149+
if !retransmit.x.payloadBuffer.IsClosed() {
150150
logger.WithError(err).Errorf("unexpected error while retransmitting payload from [@/%v]", retransmit.x.address)
151151
self.retransmissionFailures.Mark(1)
152152
self.faultReporter.ReportForwardingFault(retransmit.payload.CircuitId, retransmit.x.ctrlId)

xgress/xgress.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,11 @@ func (self *Xgress) CloseRxTimeout() {
304304
}
305305

306306
func (self *Xgress) Unrouted() {
307-
// if we're unrouted no more data is inbound
307+
// if we're unrouted no more data is inbound. this still allows already queued data to flow to the client
308308
self.CloseXgToClient()
309309

310-
// When we're unrouted, if 'end of circuit' hasn't already arrived, give incoming/queued data
311-
// a chance to outflow before closing. We're unrouted so no point in sending EOF
312-
self.payloadBuffer.CloseWhenEmpty()
310+
// If we're unrouted, we can't send any more data, so close the payload buffer
311+
self.payloadBuffer.Close()
313312
}
314313

315314
func (self *Xgress) CloseXgToClient() {

ziti/edge/network/conn.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,12 @@ func (conn *edgeConn) CloseWrite() error {
108108
headers := channel.Headers{}
109109
headers.PutUint32Header(edge.FlagsHeader, edge.FIN)
110110
_, err := conn.WriteTraced(nil, nil, headers)
111-
return err
112-
}
113111

114-
if conn.xgCircuit != nil {
115-
conn.xgCircuit.xg.CloseRxTimeout()
112+
if conn.xgCircuit != nil {
113+
conn.xgCircuit.xg.CloseRxTimeout()
114+
}
115+
116+
return err
116117
}
117118

118119
return nil

0 commit comments

Comments
 (0)