Skip to content

Commit d15c0ce

Browse files
authored
stop reporting traces after the worker process begins to exit (#105)
1 parent 406d442 commit d15c0ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/skywalking/client.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,14 @@ function Client:reportTraces(metadata_buffer, backend_http_uri)
204204
end
205205

206206
segmentTransform = segmentTransform .. segment
207-
segment = queue:rpop(Const.segment_queue)
208207
count = count + 1
209208

209+
if ngx.worker.exiting() then
210+
break
211+
end
212+
213+
segment = queue:rpop(Const.segment_queue)
214+
210215
if count >= SEGMENT_BATCH_COUNT then
211216
if sendSegments('[' .. segmentTransform .. ']', backend_http_uri) then
212217
totalCount = totalCount + count

0 commit comments

Comments
 (0)