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: DIA-1116: Deleting predictions timing out #5882

Merged
merged 2 commits into from
May 15, 2024
Merged

Conversation

hakan458
Copy link
Collaborator

@hakan458 hakan458 commented May 14, 2024

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

After evaluating a model on all tasks, and running a second time, we first delete all predictions before starting thew new job. However, this was taking a super long time for projects with a lot of tasks - causing a timeout in some cases. Now we are performing a _raw_delete() on these predictions, which bypasses the ORM. So we need to manually handle any foreign key relationships - which in this case we have one. When we create an annotation from a prediction, the parent_prediction field is set. When deleting through ORM, we are setting that field to null - so doing the same thing here. Operation is much much faster almost instant now.

What does this fix?

(if this is a bug fix)

What is the new behavior?

(if this is a breaking or feature change)

What is the current behavior?

(if this is a breaking or feature change)

What libraries were added/updated?

(list all with version changes)

Does this change affect performance?

(if so describe the impacts positive or negative)

Does this change affect security?

(if so describe the impacts positive or negative)

What alternative approaches were there?

(briefly list any if applicable)

What feature flags were used to cover this change?

(briefly list any if applicable)

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

@github-actions github-actions bot added the fix label May 14, 2024
Copy link

netlify bot commented May 14, 2024

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit e284073
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/6644faf896ff7e0008b26374

Copy link

netlify bot commented May 14, 2024

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit e284073
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/6644faf81b736a0008741711

Copy link

codecov bot commented May 14, 2024

Codecov Report

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

Project coverage is 75.97%. Comparing base (ec26634) to head (e284073).
Report is 7 commits behind head on develop.

Files Patch % Lines
label_studio/ml_models/models.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5882      +/-   ##
===========================================
- Coverage    75.99%   75.97%   -0.03%     
===========================================
  Files          159      159              
  Lines        13374    13377       +3     
===========================================
- Hits         10164    10163       -1     
- Misses        3210     3214       +4     
Flag Coverage Δ
pytests 75.97% <20.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hakan458 hakan458 merged commit cc4730c into develop May 15, 2024
37 of 39 checks passed
@hakan458 hakan458 deleted the fb-dia-1116 branch May 15, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants