Skip to content

fix(DATAGO-126524): SSE viz queue full log spam: evict oldest message instead of dropping newest#1098

Open
amir-ghasemi wants to merge 2 commits intomainfrom
amir/fix-viz-queue
Open

fix(DATAGO-126524): SSE viz queue full log spam: evict oldest message instead of dropping newest#1098
amir-ghasemi wants to merge 2 commits intomainfrom
amir/fix-viz-queue

Conversation

@amir-ghasemi
Copy link
Collaborator

This pull request introduces improvements to how visualization messages are managed and logged in the SSE gateway component, specifically to reduce log spam and ensure fresher data for clients during message bursts. The main changes are the addition of a per-stream drop counter and a new eviction-based queue handling strategy, along with cleanup and refactoring of related logging logic.

Visualization message queue handling and logging improvements:

  • Added a new _viz_stream_drop_counts dictionary to track cumulative message drop counts per stream, enabling throttled WARNING log messages during bursts. This helps operators stay informed without flooding logs. (src/solace_agent_mesh/gateway/http_sse/component.py)
  • Introduced the _put_viz_msg_to_stream method, which implements an oldest-first eviction strategy for full queues. When the queue is full, the oldest message is evicted and the new message is inserted, with warning logs emitted once every 10 evictions per stream. (src/solace_agent_mesh/gateway/http_sse/component.py)
  • Refactored the visualization message processor loop to use the new _put_viz_msg_to_stream method, replacing previous direct queue handling and simplifying the logic. (src/solace_agent_mesh/gateway/http_sse/component.py)

Cleanup and resource management:

  • Ensured that _viz_stream_drop_counts is cleared in the cleanup method to prevent stale counters and memory leaks. (src/solace_agent_mesh/gateway/http_sse/component.py)

Removal of redundant and complex error handling:

  • Removed the previous error handling logic for queue full scenarios, including background task checks and differentiated log messages, now replaced by the unified eviction and logging strategy. (src/solace_agent_mesh/gateway/http_sse/component.py)

@sonarqube-solacecloud
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
13.6% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant