Feature/dynamic polling - #31
Merged
Merged
Conversation
Implement comprehensive polling infrastructure for long-running operations: Features: - Add support_polling parameter to @validated decorator - Extract pollRequestId from request body before validation - Track operation progress via DynamoDB poll_status table - Implement PollStatusHandler logging to update poll records in real-time - Add thread-local request context for poll tracking - Rate-limit DynamoDB updates (5 second minimum interval) - Auto-finalize poll status on success/failure with cleanup - Fail-safe design: all polling operations wrapped in try/except New functions: - _init_poll_status_record(): Initialize poll tracking in DynamoDB - _finalize_poll_status_record(): Update final status and cleanup - activate_poll_tracking(): Enable poll logging for current request - deactivate_poll_tracking(): Disable poll logging - get_active_poll_request_id(): Get current poll request ID - PollStatusHandler: Custom logging handler for DynamoDB updates Testing: - Add 16 new tests for polling functionality - Add 11 new tests for logger poll status handler - Achieve 100% test coverage (888 tests passing) - Test all exception handlers and fail-safe behaviors DynamoDB Schema: - requestId (partition key): Unique poll request ID - user (sort key): Username from auth claims - status: processing/completed/failed - lastLog: Most recent log message - lastLogLevel: Log level (INFO/ERROR/etc) - ttl: Auto-cleanup after 14 days
- Added calls to `deactivate_poll_tracking()` in the `validated` function to ensure poll tracking is disabled right after the finalization of poll status. - This change prevents any subsequent logs from overwriting the completed status, improving the accuracy of logging during polling operations.
- Removed the `operation` parameter from `activate_poll_tracking` and related functions to streamline the API. - Updated logging behavior to ensure that the poll status record remains in DynamoDB for frontend retrieval, rather than being deleted after finalization. - Adjusted tests to reflect these changes, ensuring accurate assertions regarding poll status record handling.
…r unclaimed results cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.