Skip to content

Commit

Permalink
implement feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlu committed Dec 16, 2024
1 parent b3a5773 commit ef16359
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/network/tracer/connection/ebpfless/tcp_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type TCPProcessor struct {
}

// TODO make this into a config value
const maxPendingConns = 1024
const maxPendingConns = 4096

// NewTCPProcessor constructs an empty TCPProcessor
func NewTCPProcessor(cfg *config.Config) *TCPProcessor {
Expand Down
8 changes: 5 additions & 3 deletions pkg/network/tracer/connection/ebpfless_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,11 @@ func (t *ebpfLessTracer) processConnection(
case ebpfless.ProcessResultStoreConn:
maxTrackedConns := int(t.config.MaxTrackedConnections)
ok := ebpfless.WriteMapWithSizeLimit(t.conns, conn.ConnectionTuple, conn, maxTrackedConns)
// we don't have enough space to add this connection, remove its TCP state tracking
if !ok && conn.Type == network.TCP {
t.tcp.RemoveConn(conn.ConnectionTuple)
if !ok {
// we don't have enough space to add this connection, remove its TCP state tracking
if conn.Type == network.TCP {
t.tcp.RemoveConn(conn.ConnectionTuple)
}
ebpfLessTracerTelemetry.droppedConnections.Inc()
}
case ebpfless.ProcessResultCloseConn:
Expand Down

0 comments on commit ef16359

Please sign in to comment.