Skip to content
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

bug: pubsub connection attempts in endless loop #1129

Open
mfreeman451 opened this issue Oct 18, 2024 · 1 comment
Open

bug: pubsub connection attempts in endless loop #1129

mfreeman451 opened this issue Oct 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mfreeman451
Copy link
Contributor

Describe the bug
While attempting to run all of the go tests in this project from my personal machine, which I understand probably doesn't have the proper test environment, I noticed the pubsub tests attempting to make a connection to the pubsub in an endless loop.

{"level":"ERROR","time":"2024-10-18T15:18:45.425787-05:00","message":"error in subscription for topic products: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425809-05:00","message":"cannot subscribe as consumer_id is not provided in configs","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425798-05:00","message":"error in subscription for topic order-logs: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.42582-05:00","message":"cannot subscribe as consumer_id is not provided in configs","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425826-05:00","message":"error while reading from topic order-logs, err: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.42583-05:00","message":"error in subscription for topic order-logs: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425815-05:00","message":"error while reading from topic products, err: consumer group id not provided","gofrVersion":"dev"}

I think we should consider implementing some kind of exponential retry/backoff strategy here and consider returning an error.

To Reproduce
Steps to reproduce the behavior, if applicable:

  1. The code is

go test -v ./...


2. The error is

{"level":"ERROR","time":"2024-10-18T15:18:45.425787-05:00","message":"error in subscription for topic products: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425809-05:00","message":"cannot subscribe as consumer_id is not provided in configs","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425798-05:00","message":"error in subscription for topic order-logs: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.42582-05:00","message":"cannot subscribe as consumer_id is not provided in configs","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425826-05:00","message":"error while reading from topic order-logs, err: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.42583-05:00","message":"error in subscription for topic order-logs: consumer group id not provided","gofrVersion":"dev"}
{"level":"ERROR","time":"2024-10-18T15:18:45.425815-05:00","message":"error while reading from topic products, err: consumer group id not provided","gofrVersion":"dev"}


**Expected behavior**
Should return an error eventually.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environments (please complete the following information):**
- OS: [e.g. Linux]
- gofr version [e.g. v1.5.0]
- go version [e.g. 1.21]

**More description**
Add any other context about the problem here.
@vipul-rawat vipul-rawat added the bug Something isn't working label Oct 22, 2024
@vipul-rawat
Copy link
Member

@mfreeman451 This is not a retry connection, but a subscription issue with Kafka where when it is trying to subscribe to the topic, the consumer group ID is not provided, and it throws the error that you mentioned.

I think we should look for a solution where the subscription cannot start until the pubsub is connected and ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants