feat: Complete Cloud Tasks API integration for PushQueue (v2beta2)#143
Closed
riddhi-shivhare wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
Closed
feat: Complete Cloud Tasks API integration for PushQueue (v2beta2)#143riddhi-shivhare wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
riddhi-shivhare wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
Conversation
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.
Overview
This PR introduces the capability to route App Engine TaskQueue (PushQueue) requests directly to the Cloud Tasks API, bypassing the legacy Appserver entirely. This implementation is designed to provide full backward compatibility, allowing users to migrate to the modern Cloud Tasks backend without requiring any changes to their application code.
Key Architectural Changes (vs. Legacy Appserver)
apiproxy_stub_map.MakeSyncCall) with direct calls to the Cloud Tasks frontend using thetasks_v2beta2.CloudTasksClient()via a thread-safe Singleton.TaskQueueAddRequestprotobufs into modern Cloud TasksAppEngineHttpRequestpayloads. This includes mapping HTTP methods, transferring raw byte payloads, preserving headers, and formatting ETAs toschedule_time.UserRPCobjects (expectingget_result,check_success, and state assertions) even for synchronous calls. This PR introduces a_SimpleSyncRPCwrapper that intercepts and flawlessly mimics the Appserver's response lifecycle back to the caller.FetchQueueStatsrequests and maps the modern Cloud TasksQueueStatsobject back into the legacyQueueStatisticsformat. This accurately translates fields liketasks_counttotasks, and convertsoldest_estimated_arrival_timeback to legacy POSIX microsecond timestamps (oldest_eta_usec).GAE_USE_CLOUDTASKS_PATH=trueenvironment variable._backend_usedattribute intoTaskandQueueStatisticsobjects to help demo/monitoring apps visibly differentiate between "Cloud Tasks" and "Legacy TaskQueue" executions.Supported Operations
add(Single Push Tasks)delete_tasks(Single Task Deletion)purge(Queue Purging)fetch_statistics(Rich queue stats mapping)(Note: Batch operations like
BulkAddand batch deletes are currently safeguarded withNotImplementedErrorwhile the underlying batch APIs are developed, and will be implemented in a subsequent PR).