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

[Task]: Cron jobs should run for all organizations and only one pod should run the cron job #39068

Closed
abhvsn opened this issue Feb 6, 2025 · 0 comments · Fixed by #39171
Closed
Assignees
Labels
Cloud Billing Label to aggregate tickets related to multi-tenancy/cloud billing. Platform Administration Pod Issues related to platform administration & management Task A simple Todo

Comments

@abhvsn
Copy link
Contributor

abhvsn commented Feb 6, 2025

Existing crons:

  1. License check
  2. Feature flags
  3. Member update/sync for seat based pricing

Also move the crons running in PingScheduledTask to ScheduledTask to enable crons on Appsmith cloud.

@Nikhil-Nandagopal Nikhil-Nandagopal added the Task A simple Todo label Feb 6, 2025
@abhvsn abhvsn self-assigned this Feb 6, 2025
@abhvsn abhvsn added Cloud Billing Label to aggregate tickets related to multi-tenancy/cloud billing. and removed Billing & Usage Pod labels Feb 7, 2025
@github-actions github-actions bot added the Platform Administration Pod Issues related to platform administration & management label Feb 7, 2025
abhvsn added a commit that referenced this issue Feb 25, 2025
…#39171)

## Description
PR to update crons:
1. Execute crons for all orgs present in the DB
2. Add distributed locking mechanism to run cron by a single pod in
multi-clustered setup
3. Add orgId in the analytics event which are part of cron to filter
based on the combination of instanceId and orgId

##### TODOs:
1. Need to introduce a way to pass orgId while fetching organization
level feature flags
- When fetching flags for anonymous user orgId is not present in the
session
- While using methods annotated with @FeatureFlagged without the user
context (server internal workflow)
2. Currently we are fetching status of license and org level feature
flags at the startup, which was fine but going forward to avoid initial
delay we need to find better alternative to this.

Fixes #39068,
#39388

/test All

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/13519994895>
> Commit: c1b8e5d
> Workflow: `PR Automation test suite`
> Tags: `@tag.All`
> Spec: ``
> <hr>Tue, 25 Feb 2025 11:19:31 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced organization management with dynamic feature flag updates and
improved restart handling.
- Added distributed locking to scheduled background tasks for increased
stability and reliability in multi-tenant environments.
- Introduced new methods for retrieving all organizations and managing
organization configurations.
- New logging capabilities for better visibility into method invocation
failures.

- **Refactor**
- Streamlined internal workflows with enhanced logging and optimized
reactive processing, ensuring better monitoring and system
responsiveness.
- Improved method signatures and error handling for better clarity and
functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cloud Billing Label to aggregate tickets related to multi-tenancy/cloud billing. Platform Administration Pod Issues related to platform administration & management Task A simple Todo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants