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

Make operations resilent to Queue disconnection #512

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Jun 30, 2024

What kind of change does this PR introduce?

Bug fix

What is the new behavior?

Dependencies Updates:

  • Updated dependencies to fix vulnerabilities

Queue:

  • added QUEUE_WEBHOOK_MAX_CONNECTIONS env to control the HTTP webhook pool size
  • added PG_QUEUE_READ_WRITE_TIMEOUT env to abort queue operations if above that threshold
  • added PG_QUEUE_MAX_CONNECTIONS env to control how many connections the Queue can use
  • Handling cases where the queue is not reachable, in the events that the queue is not reachable the Event will be sent synchronously instead of via a Queue

Tenant DB:

  • added timeout of 5s for waitObjectLock
  • removed non useful SQL scope switch

Multitenant DB:

  • Finetuned pool parameters

Logging:

  • fixed: responseTime on aborted requests
  • added objectVersion to the logs for better traceability)
  • added metadata to ObjectDelete event
  • added region field top level

Folder Structure:

  • Refactored location of server.ts,shutdown.ts,worker.ts, they are now nested inside the start/ folder
  • Refactored queue base event to its internal package @internal/queue

@coveralls
Copy link

coveralls commented Jun 30, 2024

Pull Request Test Coverage Report for Build 9732615382

Details

  • 79 of 138 (57.25%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 79.39%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/webhook.ts 2 3 66.67%
src/storage/database/knex.ts 27 30 90.0%
src/storage/uploader.ts 21 32 65.63%
src/storage/events/base-event.ts 2 46 4.35%
Totals Coverage Status
Change from base Build 9694270096: -0.1%
Covered Lines: 12865
Relevant Lines: 16068

💛 - Coveralls

@fenos fenos force-pushed the storage/webhooks-max-http-connections branch 4 times, most recently from 38cb4e8 to 2670782 Compare July 2, 2024 10:11
@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9759063099

Details

  • 217 of 358 (60.61%) changed or added relevant lines in 20 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 79.421%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/webhook.ts 3 4 75.0%
src/storage/database/knex.ts 27 30 90.0%
src/internal/queue/queue.ts 5 9 55.56%
src/storage/uploader.ts 21 33 63.64%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.1%
Covered Lines: 12890
Relevant Lines: 16093

💛 - Coveralls

@fenos fenos force-pushed the storage/webhooks-max-http-connections branch 2 times, most recently from d7d2d6d to 57eebd6 Compare July 2, 2024 10:28
@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9759296430

Details

  • 244 of 388 (62.89%) changed or added relevant lines in 20 files are covered.
  • 19 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.09%) to 79.435%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/events/webhook.ts 3 5 60.0%
src/storage/database/knex.ts 27 30 90.0%
src/internal/queue/queue.ts 5 9 55.56%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/event.ts 95 216 43.98%
Files with Coverage Reduction New Missed Lines %
src/storage/object.ts 19 90.93%
Totals Coverage Status
Change from base Build 9694270096: -0.09%
Covered Lines: 12910
Relevant Lines: 16115

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9759314996

Details

  • 244 of 388 (62.89%) changed or added relevant lines in 20 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 79.437%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/events/webhook.ts 3 5 60.0%
src/storage/database/knex.ts 27 30 90.0%
src/internal/queue/queue.ts 5 9 55.56%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.09%
Covered Lines: 12912
Relevant Lines: 16117

💛 - Coveralls

@fenos fenos force-pushed the storage/webhooks-max-http-connections branch from 57eebd6 to 1d9abbf Compare July 2, 2024 12:17
@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9760775005

Details

  • 244 of 388 (62.89%) changed or added relevant lines in 20 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 79.437%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/events/webhook.ts 3 5 60.0%
src/storage/database/knex.ts 27 30 90.0%
src/internal/queue/queue.ts 5 9 55.56%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.09%
Covered Lines: 12912
Relevant Lines: 16117

💛 - Coveralls

@fenos fenos force-pushed the storage/webhooks-max-http-connections branch from 1d9abbf to 704a66f Compare July 2, 2024 12:33
@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9761028544

Details

  • 269 of 441 (61.0%) changed or added relevant lines in 21 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 79.347%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/events/webhook.ts 3 5 60.0%
src/storage/database/knex.ts 27 30 90.0%
src/internal/queue/queue.ts 6 18 33.33%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/database.ts 20 40 50.0%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.2%
Covered Lines: 12937
Relevant Lines: 16169

💛 - Coveralls

@fenos fenos force-pushed the storage/webhooks-max-http-connections branch 2 times, most recently from f43e017 to 53e40e0 Compare July 2, 2024 13:09
@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9761565896

Details

  • 274 of 447 (61.3%) changed or added relevant lines in 21 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 79.35%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/database/knex.ts 27 30 90.0%
src/storage/events/webhook.ts 4 7 57.14%
src/internal/queue/queue.ts 6 18 33.33%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/database.ts 20 40 50.0%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.2%
Covered Lines: 12942
Relevant Lines: 16175

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9761587257

Details

  • 274 of 447 (61.3%) changed or added relevant lines in 21 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 79.35%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/database/knex.ts 27 30 90.0%
src/storage/events/webhook.ts 4 7 57.14%
src/internal/queue/queue.ts 6 18 33.33%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/database.ts 20 40 50.0%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.2%
Covered Lines: 12942
Relevant Lines: 16175

💛 - Coveralls

@fenos fenos force-pushed the storage/webhooks-max-http-connections branch from 53e40e0 to 401752d Compare July 2, 2024 14:54
@fenos fenos merged commit 7376f97 into master Jul 2, 2024
1 check passed
@fenos fenos deleted the storage/webhooks-max-http-connections branch July 2, 2024 14:58
Copy link

github-actions bot commented Jul 2, 2024

🎉 This PR is included in version 1.6.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9763276066

Details

  • 278 of 454 (61.23%) changed or added relevant lines in 22 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 79.346%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/events/object-admin-delete.ts 2 3 66.67%
src/storage/object.ts 24 25 96.0%
src/storage/database/knex.ts 27 30 90.0%
src/storage/events/webhook.ts 4 7 57.14%
src/storage/uploader.ts 22 34 64.71%
src/internal/queue/queue.ts 6 21 28.57%
src/internal/queue/database.ts 20 40 50.0%
src/internal/queue/event.ts 95 216 43.98%
Totals Coverage Status
Change from base Build 9694270096: -0.2%
Covered Lines: 12945
Relevant Lines: 16180

💛 - Coveralls

@fenos fenos changed the title Make operations redundant to Queue disconnection Make operations resilent to Queue disconnection Jul 3, 2024
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.

3 participants