Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error logging for timeout and rate limit responses #29

Open
Molier opened this issue Feb 4, 2025 · 0 comments
Open

Improve error logging for timeout and rate limit responses #29

Molier opened this issue Feb 4, 2025 · 0 comments

Comments

@Molier
Copy link

Molier commented Feb 4, 2025

Description:
The current logging behavior for HTTP timeouts and 429 (Too Many Requests) responses results in excessive stack trace spam in the logs. This makes troubleshooting difficult and consumes unnecessary storage.

Problem Examples:

  1. Timeout Errors
    When a request to a subtitle provider (e.g., Podnapisi.NET) times out, the full stack trace is logged:

    [ERR] subbuzz.Providers.PodnapisiNet: GET: [URL] Search error: System.Threading.Tasks.TaskCanceledException...
    [Full stack trace]
    
  2. Rate Limit Errors
    When receiving 429 responses, the plugin logs the full exception:

    [ERR] subbuzz.Providers.PodnapisiNet: GET: [URL] Search error: MediaBrowser.Common.Extensions.RateLimitExceededException...
    [Full stack trace]
    

Suggested Improvements:

  1. For timeout exceptions:

    • Log a concise warning message instead of full stack trace
    • Example:
      [WRN] Request to Podnapisi.NET timed out after 20s (URL: [URL])
  2. For 429 responses:

    • Log as warning instead of error
    • Include Retry-After period if available in response headers
    • Example:
      [WRN] Podnapisi.NET rate limit exceeded. Retry after 120s
  3. General improvements:

    • Add cooldown periods between repeated warnings for the same endpoint
    • Include helper text like "This may indicate network issues or server-side throttling" in timeout messages

Benefits:

  • Reduces log noise while preserving important diagnostic information
  • Makes rate limiting behavior more explicit
  • Helps users distinguish between temporary issues vs actual errors
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

No branches or pull requests

1 participant