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

FI-2836: Fix double requests from suite endpoints #505

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

Jammjammjamm
Copy link
Collaborator

Summary

I investigated the incoming requests showing up twice in the UI. I logged the stack trace where each was being persisted:

09:31:58 web.1    | **************************START****************************
09:31:58 web.1    | I, [2024-06-17T09:31:58.067544 #64323]  INFO -- : get body
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/inferno_core-0.4.38/lib/inferno/utils/middleware/request_logger.rb:37:in `each'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/inferno_core-0.4.38/lib/inferno/utils/middleware/request_logger.rb:37:in `call'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rack-2.2.9/lib/rack/static.rb:161:in `call'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/configuration.rb:252:in `call'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/request.rb:77:in `block in handle_request'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/request.rb:76:in `handle_request'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/server.rb:443:in `process_client'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
09:31:58 web.1    | ************************** END ****************************
09:31:58 web.1    | **************************START****************************
09:31:58 web.1    | I, [2024-06-17T09:31:58.096594 #64323]  INFO -- : get body
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/request.rb:182:in `block in handle_request'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/request.rb:182:in `each'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/request.rb:182:in `handle_request'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/server.rb:443:in `process_client'
09:31:58 web.1    | /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/puma-5.6.8/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
09:31:58 web.1    | ************************** END ****************************

The second one is correct where puma is handling the rack.after_reply callback. The first is because I messed up the conditional to persist these requests during testing when puma isn't running.

Testing Guidance

In the crd test kit, run bundle info inferno_core. This will tell you the location of the version inferno core being used in that test kit. If you change the condition there just like in this PR, start the test kit, and run the tests, you should see that the requests are no longer duplicated.

@Jammjammjamm Jammjammjamm self-assigned this Jun 17, 2024
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.71%. Comparing base (0a95ece) to head (0fb586f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #505   +/-   ##
=======================================
  Coverage   79.70%   79.71%           
=======================================
  Files         240      240           
  Lines       11925    11924    -1     
  Branches     1168     1168           
=======================================
  Hits         9505     9505           
+ Misses       1757     1756    -1     
  Partials      663      663           
Flag Coverage Δ
backend 92.27% <100.00%> (+0.02%) ⬆️
frontend 74.07% <ø> (ø)

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.

Copy link
Contributor

@emichaud998 emichaud998 left a comment

Choose a reason for hiding this comment

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

Looks good and confirmed it fixes the issue I was seeing on my branch

@Jammjammjamm Jammjammjamm merged commit 4b48919 into main Jun 17, 2024
10 checks passed
@Jammjammjamm Jammjammjamm deleted the fi-2836-fix-double-requests branch June 17, 2024 16:29
@rpassas rpassas mentioned this pull request Jun 25, 2024
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.

2 participants