Skip to content

Fix bug that causes Apisonator to stop pinging System to fetch events#292

Merged
bors[bot] merged 2 commits intomasterfrom
fix-events-pending-ping
Jun 21, 2021
Merged

Fix bug that causes Apisonator to stop pinging System to fetch events#292
bors[bot] merged 2 commits intomasterfrom
fix-events-pending-ping

Conversation

@davidor
Copy link
Copy Markdown
Contributor

@davidor davidor commented Jun 21, 2021

The current code fails if the incr call is made effective in Redis but the client returns an error because of a timeout. When that happens, which should be pretty rare, apisonator stops sending events because from that moment, ping_key_value.to_i == 1 in

return false unless ping_key_value.to_i == 1
will always be false.

@davidor davidor requested a review from unleashed June 21, 2021 15:26
Comment thread spec/unit/event_storage_spec.rb
davidor added 2 commits June 21, 2021 17:28
The previous code fails if the incr call is made effective in Redis but
the client returns an error because of a timeout. When that happens,
which should be pretty rare, apisonator stops sending events because
from that moment, `ping_key_value.to_i == 1` will always be false.
Setting a TTL was working before because it's a valid value for the
"expire" Redis command. We need to change this, because when using "SET"
with a TTL, it raises.
@davidor davidor force-pushed the fix-events-pending-ping branch from 66e6a26 to 36f1d35 Compare June 21, 2021 15:29
Copy link
Copy Markdown
Contributor

@unleashed unleashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

Comment thread spec/unit/event_storage_spec.rb
@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Jun 21, 2021

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Jun 21, 2021

Build succeeded:

@bors bors Bot merged commit 1f98be3 into master Jun 21, 2021
@davidor davidor deleted the fix-events-pending-ping branch June 21, 2021 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants