Skip to content

invalid aeTimer when returning AE_NOMORE#8022

Merged
yossigo merged 1 commit intoredis:unstablefrom
tzongw:module-aetimer
Nov 11, 2020
Merged

invalid aeTimer when returning AE_NOMORE#8022
yossigo merged 1 commit intoredis:unstablefrom
tzongw:module-aetimer

Conversation

@tzongw
Copy link
Contributor

@tzongw tzongw commented Nov 5, 2020

In module.c, when moduleTimerHandler returning AE_NOMORE, aeTimer become invalid. Next time when RM_CreateTimer is called, we know we must create a new aeTimer directly.

@yossigo
Copy link
Collaborator

yossigo commented Nov 10, 2020

Hi @tzongw, I don't see where this creates a problem. If moduleTimerHandler returns with AE_NOMORE then aeTimer != -1 indeed but it also implies that Timers have no elements. Therefore, the next call to RM_CreateTimer will always end up adding the first entry and therefore deleting and reinstalling the timer.

@tzongw
Copy link
Contributor Author

tzongw commented Nov 11, 2020

Yes, no running problem here, but it's problem prone. Imaging ae changes it's implementation, timer id is unique only when it's valid(or say timer id is reusing), just like RM_CreateTimer. Deleting a dangle timer id means you may delete another timer by mistake.

@yossigo yossigo merged commit d5059ba into redis:unstable Nov 11, 2020
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Nov 19, 2020
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