This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git
The following commit(s) were added to refs/heads/main by this push:
new 738b1a4 Reduce the socket upload count to fix the program too long
issue (#192)
738b1a4 is described below
commit 738b1a42fe4941e0b4e6f5816403437cf572708f
Author: mrproliu <[email protected]>
AuthorDate: Fri Apr 25 15:34:00 2025 +0800
Reduce the socket upload count to fix the program too long issue (#192)
---
bpf/include/socket_data.h | 4 +---
pkg/accesslog/collector/protocols/http1.go | 2 +-
pkg/accesslog/collector/protocols/queue.go | 5 +++--
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/bpf/include/socket_data.h b/bpf/include/socket_data.h
index 248b34c..67f4823 100644
--- a/bpf/include/socket_data.h
+++ b/bpf/include/socket_data.h
@@ -21,7 +21,7 @@
#include "protocol_analyzer.h"
#include "queue.h"
-#define SOCKET_UPLOAD_CHUNK_LIMIT 12
+#define SOCKET_UPLOAD_CHUNK_LIMIT 6
struct socket_data_upload_event {
__u8 protocol;
@@ -208,8 +208,6 @@ static __always_inline void upload_socket_data_iov(void
*ctx, struct iovec* iov,
UPLOAD_PER_SOCKET_DATA_IOV();
UPLOAD_PER_SOCKET_DATA_IOV();
UPLOAD_PER_SOCKET_DATA_IOV();
- UPLOAD_PER_SOCKET_DATA_IOV();
- UPLOAD_PER_SOCKET_DATA_IOV();
}
struct socket_data_last_id_t {
diff --git a/pkg/accesslog/collector/protocols/http1.go
b/pkg/accesslog/collector/protocols/http1.go
index 6af2965..b4edcb7 100644
--- a/pkg/accesslog/collector/protocols/http1.go
+++ b/pkg/accesslog/collector/protocols/http1.go
@@ -223,7 +223,7 @@ func (p *HTTP1Protocol) HandleHTTPData(metrics
*HTTP1Metrics, connection *Partit
if !allInclude {
return fmt.Errorf("cannot found full detail events for HTTP/1.x
protocol, "+
"data id: %d-%d, current details count: %d",
- request.MinDataID(),
response.BodyBuffer().LastSocketBuffer().DataID(), len(details))
+ idRange.From, idRange.To, len(details))
}
http1Log.Debugf("found fully HTTP1 request and response, contains %d
detail events, "+
diff --git a/pkg/accesslog/collector/protocols/queue.go
b/pkg/accesslog/collector/protocols/queue.go
index 0c746d3..f7b7c92 100644
--- a/pkg/accesslog/collector/protocols/queue.go
+++ b/pkg/accesslog/collector/protocols/queue.go
@@ -216,8 +216,9 @@ func (p *PartitionContext) Consume(data interface{}) {
case *events.SocketDataUploadEvent:
pid, _ := events.ParseConnectionID(event.ConnectionID)
log.Debugf("receive the socket data event, connection ID: %d,
random ID: %d, pid: %d, prev data id: %d, "+
- "data id: %d, sequence: %d, protocol: %d",
- event.ConnectionID, event.RandomID, pid,
event.PrevDataID0, event.DataID0, event.Sequence0, event.Protocol0)
+ "data id: %d, sequence: %d, finished: %t, protocol: %d,
size: %d",
+ event.ConnectionID, event.RandomID, pid,
event.PrevDataID0, event.DataID0, event.Sequence0, event.IsFinished(),
+ event.Protocol0, event.BufferLen())
connection := p.GetConnectionContext(event.ConnectionID,
event.RandomID, event.Protocol0, event.DataID0)
connection.AppendData(event)
}