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

RedisConnection#Connect(): get rid of spin lock #10265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Dec 6, 2024

Instead of IoEngine::YieldCurrentCoroutine(yc) until m_Queues.FutureResponseActions.empty(), async-wait a CV which is updated along with m_Queues.FutureResponseActions.

👍 Re-connect still works on Redis restart, even if latter interrupted an outgoing message!

[2024-12-06 10:24:02 +0100] critical/IcingaDB: Error during sending query 'XADD' 'icinga:stats' 'MAXLEN' '1' '*' 'ApiListener' '{"perfdata":[{"counter":false,"crit":null,"label":"api_num_co...' ... which has been fired and forgotten: Broken pipe
[2024-12-06 10:24:02 +0100] information/IcingaDB: Connected to Redis server

ref/NC/820479
claimed they start Icinga 2 with Icinga DB enabled – and it OOMs. I hope this spin lock is not responsible, but better safe than sorry.

Also, I'm sure we all agree that spin locks should be avoided, at least where easily possible.

Instead of IoEngine::YieldCurrentCoroutine(yc) until m_Queues.FutureResponseActions.empty(), async-wait a CV which is updated along with m_Queues.FutureResponseActions.
@Al2Klimov Al2Klimov added area/icingadb New backend core/quality Improve code, libraries, algorithms, inline docs labels Dec 6, 2024
@cla-bot cla-bot bot added the cla/signed label Dec 6, 2024
@Al2Klimov Al2Klimov requested a review from yhabteab December 16, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/icingadb New backend cla/signed core/quality Improve code, libraries, algorithms, inline docs ref/NC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant