Skip to content

Commit

Permalink
update quicly-go debug branch
Browse files Browse the repository at this point in the history
  • Loading branch information
parvit committed Aug 31, 2024
1 parent 54876ab commit 35a0166
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 33 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,15 @@ jobs:
strategy:
max-parallel: 1
matrix:
backend: [ 'quicly-go' ]
cca: [ 'reno' ]
slowstart: [ 'search' ]
connection_delay_ms: [ 0, 200 ]
# backend: [ 'quic-go', 'quicly-go' ]
# cca: [ 'reno', 'cubic' ]
# slowstart: [ 'basic', 'search' ]
# connection_delay_ms: [ 0, 500 ]
# exclude:
# - backend: 'quic-go'
# slowstart: 'search'
# - backend: 'quic-go'
# cca: 'cubic'
backend: [ 'quic-go', 'quicly-go' ]
cca: [ 'reno', 'cubic' ]
slowstart: [ 'basic', 'search' ]
connection_delay_ms: [ 0, 500 ]
exclude:
- backend: 'quic-go'
slowstart: 'search'
- backend: 'quic-go'
cca: 'cubic'
uses: './.github/workflows/run-performance.yml'
with:
server_public_address: ${{ inputs.server_public_address }}
Expand Down
2 changes: 1 addition & 1 deletion backend/quicly-go
13 changes: 3 additions & 10 deletions workers/client/client_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func handleTCPConn(tcpConn net.Conn) {
}

//Proxy all stream content from quic to TCP and from TCP to quic
logger.Info("[%d] Stream Start", quicStream.ID())
logger.Debug("[%d] Stream Start", quicStream.ID())

tqActiveFlag := atomic.Bool{}
qtActiveFlag := atomic.Bool{}
Expand Down Expand Up @@ -192,7 +192,6 @@ func getQuicStream(ctx context.Context) (backend.QuicBackendStream, error) {
logger.Debug("Trying to open on existing session")
quicStream, err = localSession.OpenStream(context.Background())
if err == nil {
logger.Info("Opened a new stream: %d", quicStream.ID())
return quicStream, nil
}
// if we weren't able to open a quicStream on that session (usually inactivity timeout), we can try to open a new session
Expand Down Expand Up @@ -362,13 +361,8 @@ func handleProxyedRequest(req *http.Request, header *shared.QPepHeader, tcpConn
return shared.ErrFailed
}

logger.Info("Sending captured %s request\n", req.Method)
logger.Debug("Sending captured %s request\n", req.Method)
err = req.Write(stream)
//if err != nil {
// _ = tcpConn.Close()
// logger.Error("Error writing to tcp stream: %v", err)
// return shared.ErrFailed
//}
break

case http.MethodConnect:
Expand Down Expand Up @@ -403,8 +397,7 @@ func handleProxyedRequest(req *http.Request, header *shared.QPepHeader, tcpConn

t.Write(tcpConn)

logger.Info("Proxied connection")
logger.Info("Sending QPEP header to server, SourceAddr: %v / DestAddr: %v / ID: %v", header.SourceAddr, header.DestAddr, stream.ID())
logger.Info("(Proxied) Sending QPEP header to server, SourceAddr: %v / DestAddr: %v / ID: %v", header.SourceAddr, header.DestAddr, stream.ID())

_, err := stream.Write(header.ToBytes())
if err != nil {
Expand Down
17 changes: 8 additions & 9 deletions workers/server/server_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,11 @@ func handleQuicStream(quicStream backend.QuicBackendStream) {
//we exit (and close the TCP connection) once both streams are done copying or timeout
logger.Debug("[%v] Stream Wait", quicStream.ID())
streamWait.Wait()
logger.Info("Stream %d (duration: %v) End", quicStream.ID(), time.Now().Sub(startTime))

tcpConn.Close()
quicStream.Close()

logger.Debug("[%d] Closed TCP NetConn %s -> %s\n", quicStream.ID(), qpepHeader.SourceAddr, destAddress)
logger.Info("[%d] Closed TCP NetConn %s -> %s [%d] (%v)\n", quicStream.ID(), qpepHeader.SourceAddr, destAddress, quicStream.ID(), time.Now().Sub(startTime))
}

func handleQuicToTcp(ctx context.Context, streamWait *sync.WaitGroup, speedLimit int64, dst net.Conn, src backend.QuicBackendStream, qtFlag, tqFlag *atomic.Bool) {
Expand All @@ -233,7 +232,7 @@ func handleQuicToTcp(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
periodStart := time.Now()
periodWritten := int64(0)

logger.Info("[%d] Stream Q->T start", src.ID())
logger.Debug("[%d] Stream Q->T start", src.ID())

tskKey := fmt.Sprintf("Q->T:%v", src.ID())
tsk := shared.StartRegion(tskKey)
Expand All @@ -246,7 +245,7 @@ func handleQuicToTcp(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
tsk.End()
streamWait.Done()
qtFlag.Store(false)
logger.Error("[%d] Stream Q->T [wr:%v rd:%d] done", src.ID(), written, read)
logger.Info("[%d] Stream Q->T [wr:%v rd:%d] done", src.ID(), written, read)
}()

pktPrefix := fmt.Sprintf("%v.server.qt", src.ID())
Expand All @@ -260,7 +259,7 @@ func handleQuicToTcp(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
}

if src.IsClosed() || !tqFlag.Load() {
logger.Info("[%v] T->Q CLOSE (%v %v %v)", src.ID(), src.IsClosed(), !tqFlag.Load(), src.Sync())
logger.Debug("[%v] T->Q CLOSE (%v %v %v)", src.ID(), src.IsClosed(), !tqFlag.Load(), src.Sync())
return
}

Expand All @@ -287,7 +286,7 @@ func handleQuicToTcp(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
if err2, ok := err.(net.Error); ok && err2.Timeout() {
continue
}
logger.Error("[%d] END Q->T: %v", src.ID(), err)
logger.Error("[%d] STREAM ERR Q->T: %v", src.ID(), err)
closeStreamNow(src)
return
}
Expand All @@ -313,7 +312,7 @@ func handleTcpToQuic(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
periodStart := time.Now()
periodWritten := int64(0)

logger.Info("[%d] Stream T->Q start", dst.ID())
logger.Debug("[%d] Stream T->Q start", dst.ID())

tskKey := fmt.Sprintf("T->Q:%v", dst.ID())
tsk := shared.StartRegion(tskKey)
Expand All @@ -339,7 +338,7 @@ func handleTcpToQuic(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
}

if dst.IsClosed() || !qtFlag.Load() {
logger.Info("[%v] T->Q CLOSE (%v %v %v)", dst.ID(), dst.IsClosed(), !qtFlag.Load(), dst.Sync())
logger.Error("[%v] T->Q CLOSE (%v %v %v)", dst.ID(), dst.IsClosed(), !qtFlag.Load(), dst.Sync())
return
}

Expand All @@ -365,7 +364,7 @@ func handleTcpToQuic(ctx context.Context, streamWait *sync.WaitGroup, speedLimit
if err2, ok := err.(net.Error); ok && err2.Timeout() {
continue
}
logger.Error("[%d] END T->Q: %v", dst.ID(), err)
logger.Error("[%d] STREAM ERR T->Q: %v", dst.ID(), err)
closeStreamNow(dst)
return
}
Expand Down

0 comments on commit 35a0166

Please sign in to comment.