Bug 1364 - telemetry conns may leak in certain situation
Summary: telemetry conns may leak in certain situation
Status: CONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: other (show other bugs)
Version: unspecified
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2024-01-13 06:59 CET by sun
Modified: 2024-01-19 16:45 CET (History)
2 users (show)



Attachments

Description sun 2024-01-13 06:59:35 CET
Every time the telemetry server successfully returns from the accept, it atomically increases the value of num_clients(if < MAX_CONNECTIONS) and then executes pthread_create to create a thread to execute the client_handler function. In this function, some information will be written to the client. If the write fails, the thread returns NULL without atomically reducing num_clients, this will cause the Telemetry server to run for a period of time, and the value of num_clients will be greater than 10, resulting in telemetry being unavailable. 
Therefore, the decrease in atomicity v2_clients should occur after the write() failure
Comment 1 David Marchand 2024-01-15 09:03:37 CET
Thanks for the report.

A call to write() failing is likely a sign that something is wrong with the system but the analysis looks correct to me.
A fix could be to add a out: label at the end of the function, and jump to this label if write() fails.

Can you send a patch or do you prefer someone from the dpdk community handles it?
Comment 2 Ciara Power 2024-01-19 16:45:18 CET
Fix patch sent by reporter - thanks!
https://patches.dpdk.org/project/dpdk/patch/tencent_69E4B1D2B6C0865DA223940C173EC4904506@qq.com/

Note You need to log in before you can comment on or make changes to this bug.