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
Error during Dapr Shutdown and Message Polling Behavior Issue (AWS) #3156
Comments
/assign @amimimor |
@maintainers |
I'd like to highlight a potential additional issue with the current implementation of the subscription feature. Currently, the mapping between topics and handlers is managed by a synchronous standard library map, which is protected against race conditions using a shared lock instantiated as However, this approach has an unintended consequence: the subscription consumption logic, which relies on the To address this, we propose using a thread-safe, concurrent Go map. This would prevent write operations from being blocked by ongoing subscription consumption, thereby reducing the time required between system boot-up and accurate message handling. You can visualize the suggested solution by checking out this link. |
A PR for this change would be greatly appreciated |
/assign @amimimor |
Before submitting the PR for this issue, I'd like to highlight a few key points:
Given the intrinsic nature of the sns-sqs topology, I suggest the following steps:
|
Expected Behavior
I expect that as the number of subscriptions in Dapr increases, the following behavior should occur:
Dapr should only poll messages from subscriptions that have completed their registration process, ensuring no errors related to incomplete registration occur.
During shutdown, Dapr should gracefully stop polling messages and complete the shutdown process without errors.
Actual Behavior
The actual behavior observed is as follows:
When Dapr initializes during startup and there are multiple subscriptions, it begins polling messages from the first subscription in the list. However, this behavior can include messages from subscriptions that may not have completed their registration process, leading to the occurrence of errors.
Occasionally, during shutdown, Dapr continues to attempt message polling even after the associated topics have been unregistered. This behavior leads to the same error related to message handling, and the error message is as follows:
Steps to Reproduce the Problem
To replicate this problem, you can follow these steps:
Set up Dapr with multiple subscriptions.
Populate the SQS (Simple Queue Service) with a variety of messages.
Launch Dapr and monitor its startup behavior. Take note that Dapr might initiate message polling from subscriptions that haven't finished their registration, resulting in potential errors.
On occasion, during the shutdown process, observe Dapr's behavior as it may persist in attempting to poll messages even after the relevant topics have been unregistered. This persistence can trigger the aforementioned error message.
The text was updated successfully, but these errors were encountered: