Commit graph

622 commits

Author SHA1 Message Date
Mahima Singh
d40af1b8f4 Release 3.8.1 2026-01-14 22:44:09 +05:30
Mahima Singh
76eb62577b
Merge pull request #690 from puppetlabs/P4DEVOPS-9434
Some checks failed
Security / Mend Scanning (push) Has been cancelled
Add rate limiting and input validation security enhancements
2025-12-26 15:44:39 +05:30
Mahima Singh
7c9568466f
Merge branch 'main' into P4DEVOPS-8570 2025-12-26 15:31:29 +05:30
Mahima Singh
d0020becb3 Add rate limiting and input validation security enhancements 2025-12-24 17:43:36 +05:30
Mahima Singh
325a5c413c Revert status cache to use class variables with RuboCop exceptions
Class variables are needed here because:
- Cache must be shared across all Sinatra app instances
- Class instance variables don't work in Sinatra's dynamic instantiation model
- This is a valid use case for class variables despite RuboCop warning
2025-12-24 15:20:23 +05:30
Mahima Singh
a4abe2652a Fix RuboCop offenses 2025-12-24 15:06:22 +05:30
Mahima Singh
46e77010f6 Prevent VM allocation for already-deleted request-ids 2025-12-24 14:11:30 +05:30
Mahima Singh
7b657edd0d Add Phase 2 optimizations: status API caching and improved Redis pipelining
- Add in-memory cache for /status endpoint with 30s TTL
- Cache keyed by view parameters to handle different query patterns
- Add cache clearing for tests to prevent interference
- Optimize get_queue_metrics to use single pipeline for all Redis calls
  - Previously made 7+ separate pipeline calls
  - Now combines all queue metrics into one pipeline (7n+2 operations)
  - Reduces Redis round trips and improves API response time
- Update unit tests to match new pipelining behavior
- All 866 tests passing
2025-12-24 13:55:24 +05:30
Mahima Singh
e5c0fa986e Add performance instrumentation to key methods
- Add timing metrics to check_pool loop for monitoring cycle duration
- Add performance metrics to purge methods (pending, ready, completed queues)
- Performance metrics track operation duration using vmpooler_performance gauge
- Add warning logs for operations exceeding 5 second threshold in check_pool
- All existing metrics (clone, destroy) already have timing instrumentation
- Tests passing: 866 examples, 0 failures
2025-12-24 13:43:36 +05:30
Mahima Singh
c24fe28d6d
Merge branch 'main' into P4DEVOPS-8567 2025-12-19 14:26:43 +05:30
Mahima Singh
6d6e998bf4 Fix RuboCop style violations 2025-12-19 13:33:43 +05:30
Mahima Singh
a83916a0a4 Fix queue reliability test failures
- Add skip_metrics parameter to move_to_dlq to avoid double-counting when called from purge
- Fix purge_pending_queue to only increment count when not in dry-run mode
- Add nil check for config redis before accessing data_ttl
- Update health check tests to allow all gauge calls before checking specific metrics
- Reorder push_health_metrics to emit error/queue/task metrics before status

All 851 tests now pass including 40 queue reliability tests.
2025-12-19 13:29:34 +05:30
Mahima Singh
b3be210f99 Add DLQ, auto-purge, and health checks for Redis queues
- Implement dead-letter queue (DLQ) to capture failed VM operations
- Implement auto-purge to clean up stale queue entries
- Implement health checks to monitor queue health
- Add comprehensive tests and documentation

Features:
- DLQ captures failures from pending, clone, and ready queues
- Auto-purge removes stale VMs with configurable thresholds
- Health checks expose metrics for monitoring and alerting
- All features opt-in via configuration (backward compatible)
2025-12-19 13:17:02 +05:30
Mahima Singh
cd50c8ea65 Prevent re-queueing requests already marked as failed
- Check request status before re-queueing in clone_vm rescue block
- Only re-queue if status is not 'failed'
- Prevents infinite loop when permanent errors are detected
2025-12-19 12:18:14 +05:30
Mahima Singh
095b507a93 Add retry logic for immediate clone failures
- Check permanent_error? and retry count when clone fails immediately
- Cancel request if permanent error or max retries exceeded
- Re-queue request for retry if transient error and retries remaining
- Log retry decisions for debugging
2025-12-19 12:09:03 +05:30
Mahima Singh
0e8c3c66e9 Add debug logging to retry logic for troubleshooting 2025-12-18 22:35:06 +05:30
Mahima Singh
9e75854ec4 Fixed robo issues 2025-12-04 16:12:23 +05:30
Mahima Singh
f290c6806e Implement request cancellation handling to prevent unnecessary VM spin-up 2025-12-04 16:05:07 +05:30
isaac-hammes
e305d38a9f (maint) Release version 3.7.0 2025-05-20 13:16:23 -07:00
isaac-hammes
f6af7cd2a6 (P4DEVOPS-6096) Include VMs that have been requested but not moved to pending when getting queue metrics 2025-05-08 11:45:31 -07:00
isaac-hammes
e9598a9f47 (RE-15817) Reword fail warning and get error from redis before generating message 2023-10-11 08:48:43 -07:00
Jake Spain
811bf0bd15
3.6.0 release prep 2023-10-05 15:27:40 -04:00
isaac-hammes
04464e305c (maint) Fix message for timeout notification. 2023-08-31 11:22:58 -07:00
isaac-hammes
6eb9b9d3b1 (maint) Release prep for version 3.5.1 2023-08-24 06:37:59 -07:00
isaac-hammes
1c5b066c94 (maint) Fix bug by removing redis transaction 2023-08-23 12:03:26 -07:00
isaac-hammes
8beab7f874 (maint) Fix bug where fail_pending_vm was logging an error before any timeouts are reached. 2023-08-23 08:41:07 -07:00
isaac-hammes
1130cdd65c (maint) Release prep for version 3.5.0 2023-08-23 05:56:46 -07:00
isaac-hammes
eee7c4082a (maint) Raise error when ip address is not given to vm after clone. 2023-08-22 13:36:33 -07:00
isaac-hammes
17a1831952 (POD-8) Add timeout_notification config to log warning before vm is destroyed. 2023-08-22 12:09:17 -07:00
Jake Spain
fdbb0f3a77
Add ability to use bind_as with a service account 2023-08-21 07:17:47 -04:00
isaac-hammes
089071b1b9 (maint) Release prep for version 3.4.0 2023-08-18 08:58:37 -07:00
isaac-hammes
43f085352b (POD-10) Log reason for failed VM checks. 2023-08-17 13:41:15 -07:00
isaac-hammes
236765709a (maint) Release prep for version 3.3.0 2023-08-15 09:24:45 -07:00
isaac-hammes
e7322577c7 Fix rubocop 2023-08-10 09:24:17 -07:00
isaac-hammes
113ca2dacb
Merge branch 'main' into update_redis 2023-08-10 08:48:16 -07:00
Jake Spain
77ed477522
3.2.0 release prep 2023-08-10 09:50:58 -04:00
isaac-hammes
ac578eef15 (RE-15162) Update OTEL gems. 2023-08-10 06:15:27 -07:00
Jake Spain
c1808632c8
Do not attempt loading DNS classes if none are defined 2023-08-09 10:04:51 -04:00
isaac-hammes
46156fd85f Convert Times to strings when being added to redis. 2023-08-08 11:05:55 -07:00
isaac-hammes
30820ec115 (RE-15162) Update Redis gem to version 5 2023-08-07 08:37:17 -07:00
Jake Spain
92ad13cd04
3.1.0 release prep 2023-05-01 08:19:29 -04:00
Jake Spain
649aef7339
Rubocop fix: Style/SlicingWithRange 2023-04-21 08:43:11 -04:00
Jake Spain
0f7cc78525
3.0.0 release prep 2023-03-28 17:21:24 -04:00
Jake Spain
669ecaef48
Point dashboard to v3 api 2023-03-27 21:27:46 -04:00
Jake Spain
528e9635d1
exit application if domain setting is used 2023-03-27 21:27:45 -04:00
Jake Spain
527f42cca9
Remove api reroute in favor of using versioned api directly 2023-03-27 21:27:44 -04:00
Jake Spain
93201756a0
Add v3 api and remove v2 2023-03-27 21:27:43 -04:00
Jake Spain
91248fe23a
Added spec tests for Vmpooler::Dns 2023-03-27 21:27:40 -04:00
Jake Spain
eaa1104dd7
Fix rubocops 2023-03-27 21:27:38 -04:00
Jake Spain
da4015f5b3
Refactor obtaining and saving ip address 2023-03-27 21:27:37 -04:00