Abhishek Pandey 2e6cb20a59
Add limiter reset functionality (#4674)
This PR adds `Reset` support to limiter. In summary, it provides 2 things:
1. It resets limiter state & refills tokens to original capacity.
2. Reset is transparent to request senders, they can continue to call `Wait` even when reset is in progress. This is done using a new request level lock. It'll be useful towards `WaitN` implementation as well in a following PR. 

Reason for adding `Reset`:
1. Corso CLI supports backing up the entire tenant. Since exchange service limits are defined on a per app per mailbox basis, if we don't reset the sliding window limiter in between  n exchange resources, it'll artificially slow down n-1 resource backups. 
2. This is because sliding window limiter front allows front loading the requests. This is not a big problem with token bucket limiter, since it refills tokens at a constant rate of 16 per second. 
3. Ideally the rate limiter instance should be scoped to an exchange mailbox, and no `Reset` should be required. However, this would need some major refactoring of graph controller. Currently we use global rate limiter instances, and also the graph controller stays common for all resource backup operations. `Reset` allows us to keep using the global approach. 

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [x] 🕐 Yes, but in a later PR
- [ ]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2023-11-14 22:18:34 +00:00
2023-11-06 05:39:35 +00:00
2023-02-18 15:35:59 +00:00
2022-12-20 19:58:11 +00:00

Corso Logo

Corso

Go Report Card Discord License Contributor Covenant

Corso is the first open-source tool that aims to assist IT admins with the critical task of protecting their Microsoft 365 data. It provides a reliable, secure, and efficient data protection engine. Admins decide where to store the backup data and have the flexibility to perform backups of their desired service through an intuitive interface. As Corso evolves, it can become a great building block for more complex data protection workflows.

Corso is currently in Beta.

Corso supports M365 Exchange and OneDrive with SharePoint and Teams support in active development. Coverage for more services, possibly beyond M365, will expand based on the interest and needs of the community.

Getting Started

See the Corso Quickstart on our docs page.

Building Corso

To learn more about working with the project source core and building Corso, see the Developer section of the Corso Documentation.

Roadmap

You can learn more about the Corso roadmap and how to interpret it here.

If you have feature requests, please file a GitHub issue and attach the enhancement label to the issue.

Contribution Guidelines

Code of Conduct

It's important that our community is inclusive and respectful of everyone. We ask that all Corso users and contributors take a few minutes to review our Code of Conduct.

License

Corso is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Description
Free, Secure, and Open-Source Backup for Microsoft 365
Readme Pixar 182 MiB
Languages
Go 91.1%
SCSS 7%
JavaScript 1.1%
PowerShell 0.6%