Visitar URL original
Cache/Queue metrics should not be negative · Issue #2495 · huggingface/dataset-viewer · GitHub
Skip to content

Cache/Queue metrics should not be negative #2495

Open

Description

@severo

In the cache metrics collection, we have entries like:

{ _id: ObjectId("65d60409acf7b3719825797e"),
  error_code: 'PreviousStepStillProcessingError',
  http_status: 500,
  kind: 'split-duckdb-index-010',
  total: -67 }

The total should never be lower than 0

Activity

  1. changed the title [-]Cache metrics should not be negative[/-] [+]Cache/Queue metrics should not be negative[/+] on Mar 8, 2024
  2. Michal-Okularczyk commented on May 27, 2025

    @Michal-Okularczyk

    I would like to work on this bug if that's ok!

    #self-assign

  3. ArjunJagdale commented on Jul 1, 2025

    @ArjunJagdale
    Contributor

    Hi @severo! can I work on this issue??

  4. ArjunJagdale commented on Jul 1, 2025

    @ArjunJagdale
    Contributor

    Hi @severo — I think the metric write logic in collect_cache_metrics(), and will clamp total with max(total, 0) before calling .upsert_one() to prevent storing negative values.

    The total comes from get_responses_count_by_kind_status_and_error_code(), which might be worth auditing separately — but this fix will ensure DB consistency for now.

    Will raise the PR shortly — thanks again!

  5. ArjunJagdale commented on Aug 4, 2025

    @ArjunJagdale
    Contributor

    I have done a PR! just want your confirmation/thoughts..

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions