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

Fix honeypot changes in tasks with cloud data #9010

Merged
merged 10 commits into from
Feb 4, 2025

Conversation

zhiltsov-max
Copy link
Contributor

Motivation and context

  • Added missing updates of manifests on honeypot changes in tasks with cloud storage data. This change affects chunks and backups

Note: if tasks contained invalid honeypots before the update, they will require an extra manual honeypot update to become correct. There is no automatic fix for this issue.

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@zhiltsov-max zhiltsov-max requested a review from SpecLad as a code owner January 29, 2025 11:07
@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 73.73%. Comparing base (2ca90b0) to head (dcf951a).
Report is 20 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9010      +/-   ##
===========================================
+ Coverage    73.40%   73.73%   +0.32%     
===========================================
  Files          418      419       +1     
  Lines        44296    44362      +66     
  Branches      3870     3875       +5     
===========================================
+ Hits         32516    32709     +193     
+ Misses       11780    11653     -127     
Components Coverage Δ
cvat-ui 77.39% <ø> (+0.04%) ⬆️
cvat-server 70.69% <63.63%> (+0.56%) ⬆️

Comment on lines +1185 to +1189
# Update manifest
manifest_path = db_data.get_manifest_path()
if os.path.isfile(manifest_path):
manifest = ImageManifestManager(manifest_path)
manifest.reorder([db_frame.path for db_frame in db_frames.values()])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the order of the whole task manifest when updating honeypots for a single job is probably not a good idea.

Copy link
Contributor Author

@zhiltsov-max zhiltsov-max Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which problem do you see in the current implementation? We still need to pass all the images, because the manifest is a single file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which problem do you see in the current implementation?

I'm not sure whether large tasks will cause problems. This action can probably take more time than 60 seconds. + Perhaps we need to be sure that the other manifest content corresponds to db_frames, otherwise we may not be able to understand why some frames contain unmatched annotations. (I know that such a change will fix problems with unmatching frames from manifest and frame sizes from db, but just logging will be useful, I guess). Up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether large tasks will cause problems. This action can probably take more time than 60 seconds.

Why it can take a big amount of time? From what I've seen in the implementation, it should be a file construction and writing, and the file itself is at most several kb in size. Am I missing something?

Perhaps we need to be sure that the other manifest content corresponds to db_frames
I suppose there are 2 possible reasons for this:

  • it's an old task, created before the update and which had some layout updates
  • the file was updated in another thread

The first case tasks should just become correct after the next honeypot update.

The second case is described in the endpoint description. There are several places in this function where things can break in such situation. A lock or some other protection mechanism is needed, but we aren't using them for endpoint access currently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Copy link

sonarqubecloud bot commented Feb 4, 2025

@zhiltsov-max zhiltsov-max merged commit 18c1d28 into develop Feb 4, 2025
34 checks passed
@zhiltsov-max zhiltsov-max deleted the zm/fix-honeypot-changes-in-cs-tasks branch February 4, 2025 14:01
This was referenced Feb 5, 2025
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.

3 participants