IP Library Granted Patent US 12,530,229
Granted Patent B2
US 12,530,229 · App. 18/670,459 · Granted Jan 20, 2026

Asynchronous task queue configuration in a database system

Inventors: Gabriel Kliot (Redmond, WA); Ruji Xie (Bellevue, WA); Subramanian Muralidhar (Mercer Island, WA); William Waddington (Stateline, NV)
Assignee: Snowflake Inc.
G06F9/4881
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,530,229
App. No.
18/670,459
Granted
Jan 20, 2026
Kind
B2
Abstract

Techniques for configuring an asynchronous task queue are disclosed. An example method includes enqueuing, by at least one hardware processor of a first computing node, a task in a task queue. The at least one hardware processor detects a lease request for the task. The lease request is received from a second computing node. The at least one hardware processor initiates a lease of the task to the second computing node. The at least one hardware processor updates a state of the task based on the lease. The at least one hardware processor determines whether to dequeue the task based on a task processing update received from the second computing node.

Claims (92)

1 . A method comprising:

enqueuing, by at least one hardware processor of a first computing node, a task in a task queue;

detecting a lease request for the task, the lease request received from a second computing node;

initiating a lease of the task to the second computing node;

updating a state of the task based on the lease;

determining whether to dequeue the task based on a task processing update received from the second computing node; and

responsive to a dequeue request received from the second computing node and indicating completion of the task, dequeuing the task from the task queue.

2 . The method of claim 1 , comprising:

updating the state of the task to a lease state, the lease state indicating the task is leased to the second computing node for processing.

3 . The method of claim 2 , comprising:

initiating a lease timer for a pre-configured period, the lease timer starting at a time the lease is initiated.

4 . The method of claim 3 , wherein the first computing node receives the dequeue request prior to expiration of the lease timer.

5 . The method of claim 1 , comprising:

sharding the task queue into a plurality of shards; and

storing the task in a first shard of the plurality of shards.

6 . The method of claim 5 , comprising:

decoding an enqueue request received from a data process, the enqueue request including a second task; and

enqueuing the second task in a second shard of the plurality of shards.

7 . The method of claim 6 , comprising:

enqueuing one or more additional tasks received after the second task, wherein the one or more additional tasks are enqueued into corresponding shards of the plurality of shards in a round-robin configuration.

8 . The method of claim 1 , comprising:

enqueuing a second lease request received from a third computing node for a second task in the task queue; and

responsive to the enqueuing of the second lease request;

initiating a second lease of the second task to the third computing node;

initiating a lease timer for a pre-configured period, the lease timer starting a time the second lease is initiated; and

changing a state of the second task from a ready state to a leased state.

9 . The method of claim 8 , comprising:

detecting the lease timer has expired;

performing a revocation of the second lease; and

changing the state of the second task from the leased state to the ready state.

10 . A system comprising:

at least one hardware processor of a first computing node; and

at least one memory storing instructions that cause the at least one hardware processor to perform operations comprising:

enqueuing a task in a task queue;

detecting a lease request for the task, the lease request received from a second computing node;

initiating a lease of the task to the second computing node;

updating a state of the task based on the lease;

determining whether to dequeue the task based on a task processing update received from the second computing node; and

responsive to a dequeue request received from the second computing node and indicating completion of the task, dequeuing the task from the task queue.

11 . The system of claim 10 , the operations comprising:

updating the state of the task to a lease state, the lease state indicating the task is leased to the second computing node for processing.

12 . The system of claim 11 , the operations comprising:

initiating a lease timer for a pre-configured period, the lease timer starting at a time the lease is initiated.

13 . The system of claim 12 , wherein the first computing node receives the dequeue request prior to expiration of the lease timer.

14 . The system of claim 10 , the operations comprising:

sharding the task queue into a plurality of shards; and

storing the task in a first shard of the plurality of shards.

15 . The system of claim 14 , the operations comprising:

decoding an enqueue request received from a data process, the enqueue request including a second task; and

enqueuing the second task in a second shard of the plurality of shards.

16 . The system of claim 15 , the operations comprising:

enqueuing one or more additional tasks received after the second task, wherein the one or more additional tasks are enqueued into corresponding shards of the plurality of shards in a round-robin configuration.

17 . The system of claim 10 , the operations comprising:

enqueuing a second lease request received from a third computing node for a second task in the task queue; and

responsive to the enqueuing of the second lease request:

initiating a second lease of the second task to the third computing node;

initiating a lease timer for a pre-configured period, the lease timer starting a time the second lease is initiated; and

changing a state of the second task from a ready state to a leased state.

18 . The system of claim 17 , the operations comprising:

detecting the lease timer has expired;

performing a revocation of the second lease; and

changing the state of the second task from the leased state to the ready state.

19 . A computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:

enqueuing a task in a task queue of a first computing node;

detecting a lease request for the task, the lease request received from a second computing node;

initiating a lease of the task to the second computing node;

updating a state of the task based on the lease;

determining whether to dequeue the task based on a task processing update received from the second computing node; and

responsive to a dequeue request received from the second computing node and indicating completion of the task, dequeuing the task from the task queue.

20 . The computer-storage medium of claim 19 , the operations comprising:

updating the state of the task to a lease state, the lease state indicating the task is leased to the second computing node for processing.

21 . The computer-storage medium of claim 20 , the operations comprising:

initiating a lease timer for a pre-configured period, the lease timer starting at a time the lease is initiated.

22 . The computer-storage medium of claim 21 , wherein the first computing node receives the dequeue request prior to expiration of the lease timer.

23 . The computer-storage medium of claim 19 , the operations comprising:

sharding the task queue into a plurality of shards; and

storing the task in a first shard of the plurality of shards.

24 . The computer-storage medium of claim 23 , the operations comprising:

decoding an enqueue request received from a data process, the enqueue request including a second task; and

enqueuing the second task in a second shard of the plurality of shards.

25 . The computer-storage medium of claim 24 , the operations comprising:

enqueuing one or more additional tasks received after the second task, wherein the one or more additional tasks are enqueued into corresponding shards of the plurality of shards in a round-robin configuration.

26 . The computer-storage medium of claim 19 , the operations comprising:

enqueuing a second lease request received from a third computing node for a second task in the task queue; and

responsive to the enqueuing of the second lease request:

initiating a second lease of the second task to the third computing node;

initiating a lease timer for a pre-configured period, the lease timer starting a time the second lease is initiated; and

changing a state of the second task from a ready state to a leased state.

27 . The computer-storage medium of claim 26 , the operations comprising:

detecting the lease timer has expired;

performing a revocation of the second lease; and

changing the state of the second task from the leased state to the ready state.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 21, 2024
From: KLIOT, GABRIEL; XIE, RUJI; MURALIDHAR, SUBRAMANIAN; WADDINGTON, WILLIAM
To: SNOWFLAKE INC.
Reel/Frame 067483/0617 →
Continuity (2)
Continuation 18361549 · Jul 28, 2023
Related Publication 20250036464A1 · Jan 30, 2025
References Cited (22)
US 6330582B1 · Kuo et al. · 2001 [cited by applicant]
US 12032995B1 · Kliot et al. · 2024 [cited by applicant]
US 20020178282A1 · Mysore et al. · 2002 [cited by applicant]
US 20030236819A1 · Greubel · 2003 [cited by applicant]
US 20080148271A1 · Leckie · 2008 [cited by applicant]
US 20160103702A1 · Schneider · 2016 [cited by examiner]
US 20230034835A1 · Reyes · 2023 [cited by examiner]
“U.S. Appl. No. 18/361,549, Non Final Office Action mailed Oct. 12, 2023”, 8 pgs. [cited by applicant]
“U.S. Appl. No. 18/361,549, Response filed Jan. 12, 2024 to Non Final Office Action mailed Oct. 12, 2023”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 18/361,549, Notice of Allowance mailed Feb. 26, 2024”, 9 pgs. [cited by applicant]
AWS, “Amazon SQS visibility timeout”, [Online]. Retrieved from the Internet: https: docs.aws.amazon.com AWSSimpleQueueService latest SQSDeveloperGuide sqs-visibility-timeout.html, (Accessed online Jan. 17, 2024), 6 page… [cited by applicant]
AWS, “AmazonSQSClient AWS SDK for Java 1 12 635”, [Online]. Retrieved from the Internet: https: docs.aws.amazon.com AWSJavaSDK latest javadoc com amazonaws services sqs AmazonSQSClient.html, (Accessed online Jan. 17, 20… [cited by applicant]
AWS, “What is Amazon Simple Queue Service”, [Online]. Retrieved from the Internet: https: docs.aws.amazon.com AWSSimpleQueueService latest SQSDeveloperGuide welcome.html, (Accessed online 01 17 2024), 2 pages. [cited by applicant]
AWS, “List Queues”, [Online]. Retrieved from the Internet: https: docs.aws.amazon.com AWSSimpleQueueService latest APIReference API_ListQueues.html, (Accessed online Jan. 17, 2024), 7 pages. [cited by applicant]
AWS, “software.amazon.awssdk.services.sqs Interface SqsClient”, [Online]. Retrieved from the Internet: https: sdk.amazonaws.com java api latest software amazon awssdk services sqs SqsClient.html, (Accessed online Jan. 1… [cited by applicant]
AWS, “ReceiveMessageRequest”, [Online]. Retrieved from the Internet: https: docs.aws.amazon.com AWSJavaSDK latest javadoc com amazonaws services sqs model ReceiveMessageRequest.html#constructor.detail, (Accessed online … [cited by applicant]
AWS, “com.amazonaws.services.sqs.model Class SendMessageRequest”, [Online]. Retrieved from the Internet: https: docs.aws.amazon.com AWSJavaSDK latest javadoc com amazonaws services sqs model SendMessageRequest.html, (Ac… [cited by applicant]
Baeldung, “Microbenchmarking with Java”, [Online]. Retrieved from the Internet: https: www.baeldung. com java-microbenchmark-harness, (Accessed online Jan. 17, 2024), 9 pages. [cited by applicant]
Github GRPC, “Status codes and their use in gRPC”, [Online]. Retrieved from the Internet: https: github.com grpc grpc blob master doc statuscodes.md, (Accessed online Jan. 17, 2024), 6 pages. [cited by applicant]
Microsoft Learn, “Get Messages REST API Azure Storage”, [Online]. Retrieved from the Internet: https: learn.microsoft.com en-us rest api storageservices get-messages, (Accessed online Jan. 17, 2024), 7 pages. [cited by applicant]
Mozilla, “HTTP response status codes”, [Online]. Retrieved from the Internet: https: developer.mozilla.org en-US docs Web HTTP Status#client_error_responses, (Accessed online Jan. 17, 2024), 9 pages. [cited by applicant]
U.S. Appl. No. 18/361,549 U.S. Pat. No. 12,032,995, filed Jul. 28, 2023, Asynchronous Task Queue Configuration in a Database System. [cited by applicant]