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

🐛 Hot-fix: Ensure synchronization between projects/workbench and projects_nodes #4617

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Aug 17, 2023

What do these changes do?

This PR fixes the issue with synchronization between the projects table workbench column and the projects_nodes table.
The problem arises due to the following issues:
On node creation the frontend does:

  1. POST /projects/{project_id}/nodes and does not wait for an answer
  2. PUT /projects/{project_id} arrives soon after with the new node in the workbench --> works since 1. call is fast

On node deletion the frontend does:

  1. DELETE /projects/{project_id}/nodes/{node_id} and does not wait for an answer although that call is slow when a dynamic service needs to be removed (typically from .5s to several seconds).
  2. PUT /projects/{project_id} arrives soon after with the node already removed from the workbench. the call is fast an changes projects/workbench.
  3. the call in 1. then fails when it tries to remove the node from projects/workbench and projects_nodes. --> then the sync issue arises

This is a quick fix that could be applied to production code. the long fix will come after this one.
Also it would make sense that the frontend waits for the node creation/deletion calls before sending PUT calls.

Related issue/s

How to test

DevOps Checklist

@sanderegg sanderegg added the a:webserver issue related to the webserver service label Aug 17, 2023
@sanderegg sanderegg added this to the Baklava milestone Aug 17, 2023
@sanderegg sanderegg self-assigned this Aug 17, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codeclimate
Copy link

codeclimate bot commented Aug 17, 2023

Code Climate has analyzed commit 669921c and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Member

@mguidon mguidon left a comment

Choose a reason for hiding this comment

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

lgtm Thanks.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #4617 (669921c) into master (c1c5c39) will decrease coverage by 4.3%.
The diff coverage is 97.1%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4617      +/-   ##
=========================================
- Coverage    86.8%   82.5%    -4.3%     
=========================================
  Files        1049     310     -739     
  Lines       44557   15700   -28857     
  Branches     1016       0    -1016     
=========================================
- Hits        38697   12962   -25735     
+ Misses       5632    2738    -2894     
+ Partials      228       0     -228     
Flag Coverage Δ
integrationtests 54.8% <ø> (-11.9%) ⬇️
unittests 87.1% <97.1%> (+2.6%) ⬆️

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

Files Changed Coverage Δ
...erver/src/simcore_service_webserver/projects/db.py 99.4% <97.1%> (+<0.1%) ⬆️

... and 793 files with indirect coverage changes

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

lgtm

@sanderegg sanderegg merged commit f6662b7 into ITISFoundation:master Aug 17, 2023
@sanderegg sanderegg deleted the bugfix/quick-fix-projects-nodes branch August 17, 2023 07:05
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Sep 22, 2023
50 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants