Skip to content
Snippets Groups Projects

Rework the replaying exception handling

1 unresolved thread

to make it a bit more robust and give more details on what's going on in case of errors.

Add tests for those error situations.

Also improve logging in replay.py:

Add a few debug logging statements and improve the info-level summary statement at the end of process_replay_objects_content(), and fix tests accordingly.


Migrated from D8939 (view on Phabricator)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Build is green

    Patch application report for D8939 (id=32209)

    Rebasing onto 0c0fa5c7...

    Current branch diff-target is up to date.
    Changes applied before test
    commit 82e3a9258a56a064acf05dd6cf2a6ffab90d907d
    Author: David Douard <david.douard@sdfa3.org>
    Date:   Wed Dec 7 16:21:15 2022 +0100
    
        Add tests for replay scenarios with add errors
    
    commit 9156f6e1d5e68e195f7c98e6666102dfa61e2244
    Author: David Douard <david.douard@sdfa3.org>
    Date:   Wed Dec 7 16:19:11 2022 +0100
    
        Improve logging in replay.py
        
        Add a few debug logging statements and improve the info-level summary
        statement at the end of `process_replay_objects_content()`.
        
        Fix tests accordingly.
    
    commit 062d603ebb5128354137beaaec35d92614d28eb4
    Author: David Douard <david.douard@sdfa3.org>
    Date:   Mon Nov 21 16:05:24 2022 +0100
    
        Rework the replaying exception handling
        
        to make it a bit more robust and give more details on what's going on in
        case of errors.
        
        Add tests for those error situations.

    See https://jenkins.softwareheritage.org/job/DOBJSRPL/job/tests-on-diff/46/ for more details.

  • vlorentz
    vlorentz @vlorentz started a thread on the diff
1 # Copyright (C) 2022 The Software Heritage developers
  • Could you use a logger instance, and add if logger.isEnabledFor(logging.DEBUG): before logger.debug statements that use hash_to_hex?

  • Author Maintainer

    ! In !24 (closed), @vlorentz wrote: Could you use a logger instance,

    what do you mean by "use a logger instance"?

    and add if logger.isEnabledFor(logging.DEBUG): before logger.debug statements that use hash_to_hex?

    sure

  • Author Maintainer

    ! In !24 (closed), @douardda wrote:

    ! In !24 (closed), @vlorentz wrote: Could you use a logger instance,

    what do you mean by "use a logger instance"?

    and add if logger.isEnabledFor(logging.DEBUG): before logger.debug statements that use hash_to_hex?

    sure

    Actually, why would this be needed? I mean I don't expect has_to_hex() to be a fat cpu burner, do I?

  • Author Maintainer

    ! In !24 (closed), @douardda wrote:

    ! In !24 (closed), @douardda wrote:

    ! In !24 (closed), @vlorentz wrote: Could you use a logger instance,

    what do you mean by "use a logger instance"?

    and add if logger.isEnabledFor(logging.DEBUG): before logger.debug statements that use hash_to_hex?

    sure

    Actually, why would this be needed? I mean I don't expect has_to_hex() to be a fat cpu burner, do I?

    And hash_to_hex() is already lru_cached, so I don't see the true benefit of adding these if statements everywhere...

  • Author Maintainer

    Bump copyright dates

  • Build is green

    Patch application report for D8939 (id=32252)

    Rebasing onto 0c0fa5c7...

    Current branch diff-target is up to date.
    Changes applied before test
    commit 11b1b233e2b113e622f256928ec7e6273f8e60d1
    Author: David Douard <david.douard@sdfa3.org>
    Date:   Wed Dec 7 16:21:15 2022 +0100
    
        Add tests for replay scenarios with add errors
    
    commit b0989f7ed9d7771e81d8a8fd989d50b8fa4ce3c9
    Author: David Douard <david.douard@sdfa3.org>
    Date:   Wed Dec 7 16:19:11 2022 +0100
    
        Improve logging in replay.py
        
        Add a few debug logging statements and improve the info-level summary
        statement at the end of `process_replay_objects_content()`.
        
        Fix tests accordingly.
    
    commit a3e366823d810220dbfac2b24cf02fc98866ff2e
    Author: David Douard <david.douard@sdfa3.org>
    Date:   Mon Nov 21 16:05:24 2022 +0100
    
        Rework the replaying exception handling
        
        to make it a bit more robust and give more details on what's going on in
        case of errors.
        
        Add tests for those error situations.

    See https://jenkins.softwareheritage.org/job/DOBJSRPL/job/tests-on-diff/47/ for more details.

  • ! In !24 (closed), @douardda wrote:

    ! In !24 (closed), @vlorentz wrote: Could you use a logger instance,

    what do you mean by "use a logger instance"?

    I meant using the result of logging.getLogger() instead of logging directly, but you are already doing that. I don't see why I wrote that comment...

    ! In !24 (closed), @douardda wrote: And hash_to_hex() is already lru_cached, so I don't see the true benefit of adding these if statements everywhere...

    would it be called if not for logging, though?

    ! In !24 (closed), @douardda wrote: Actually, why would this be needed? I mean I don't expect has_to_hex() to be a fat cpu burner, do I?

    Heh you're right, it's only ~0.3µs on cache miss

  • Merge request was accepted

  • vlorentz approved this merge request

    approved this merge request

  • Author Maintainer

    Merge request was merged

  • closed

  • Please register or sign in to reply
    Loading