frr icon indicating copy to clipboard operation
frr copied to clipboard

Agentx thread

Open fdumontet6WIND opened this issue 4 months ago • 16 comments

  • Introduce a dedicated AgentX thread using frr_pthread.

  • Add mutex locks (ax_mtx, ax_io_mtx) to manage thread synchronization for trap transfer and I/O operations.

  • Implemented ring buffers (ibuf_ax) for handling "master -> AgentX" communication, improving data handling between threads.

  • Update the SNMP read operations to use mutex locks to ensure thread-safe execution.

  • Integrated a new dedicated thread to send SNMP traps, ensuring separation of responsibilities between the main and AgentX threads.

  • Enhanced trap handling to support multi-index traps, with excess traps being discarded if the buffer is full, preventing overflow.

  • Enhanced trap handling to support multi-index traps. When more than "RINGBUF_NB_TRAP" traps are pending for transmission, subsequent traps are discarded to prevent overflow.

This update significantly improves concurrency, synchronization, and trap management within the AgentX module, with added protection against socket's buffer overflow from excessive traps. The socket's buffer overflow is leading to process deadlock.

fdumontet6WIND avatar Oct 02 '24 19:10 fdumontet6WIND