Skip to content

Conversation

@enjoy-binbin
Copy link
Contributor

@enjoy-binbin enjoy-binbin commented Jan 22, 2024

In #11568 we removed the NOSCRIPT flag from commands, e.g. removing
NOSCRIPT flag from WAIT. Aiming to allow them in scripts and let them
implicitly behave in the non-blocking way.

This PR remove NOSCRIPT flag from WAITAOF just like WAIT (to be symmetrical)).
And this PR also add BLOCKING flag for WAIT and WAITAOF.

This looks like it was missing from 7.0 (redis#9656).
@enjoy-binbin enjoy-binbin requested a review from oranagra January 22, 2024 14:43
@madolson
Copy link
Contributor

@enjoy-binbin We added an explicit test for this:

    test {EVAL - Scripts do not block on wait} {
        run_script {return redis.pcall('wait','1','0')} 0
    } {0}

Seems intentional from #11568. I remember finding it weird behavior, but it made it consistent with multi-exec.

@enjoy-binbin
Copy link
Contributor Author

ohh. Sorry i did not bother to run a local test. In this case should we also remove noscript flag from waitaof?

@enjoy-binbin enjoy-binbin changed the title Add NOSCRIPT command flag for WAIT Allow running WAITAOF in scripts, remove NOSCRIPT flag Jan 23, 2024
@enjoy-binbin
Copy link
Contributor Author

ok, I browsed the corresponding PR again, it seems that we need to remove NOSCRIPT from WAITAOF.
Another question is, both WAIT and WAITAOF seem to lack the BLOCKING flag?

Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

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

i'm ok with this change (to be symmetrical), but i wonder if we should mention it in the release notes.
it would be pointless to use this commands in scripts after the made some modifications (we know what the response would be), so the only reason to use it in a script is to check if the commands before the scripts were synced, and in some way act according to the response.
do you think this could be useful for someone?

regarding the BLOCKING flag, this flag doesn't do anything other than the fact it is exposed in COMMAND command so that clients can tell that detail about the command.
i don't recall if there's a reason for it to be missing from WAIT*, so i don't have an objection to add it.

@oranagra
Copy link
Member

@yossigo do you see any reason to mention this in the release notes?

@oranagra oranagra merged commit 85c31e0 into redis:unstable Jan 23, 2024
@enjoy-binbin enjoy-binbin deleted the fix_wait_noscript branch January 23, 2024 13:22
@yossigo
Copy link
Collaborator

yossigo commented Jan 23, 2024

@oranagra Yes, it's a behavior change that we need to document.

@yossigo yossigo added the release-notes indication that this issue needs to be mentioned in the release notes label Jan 23, 2024
roggervalf pushed a commit to roggervalf/redis that referenced this pull request Feb 11, 2024
In redis#11568 we removed the NOSCRIPT flag from commands, e.g. removing
NOSCRIPT flag from WAIT. Aiming to allow them in scripts and let them
implicitly behave in the non-blocking way.

This PR remove NOSCRIPT flag from WAITAOF just like WAIT (to be
symmetrical)).
And this PR also add BLOCKING flag for WAIT and WAITAOF.
funny-dog pushed a commit to funny-dog/redis that referenced this pull request Sep 17, 2025
In redis#11568 we removed the NOSCRIPT flag from commands, e.g. removing
NOSCRIPT flag from WAIT. Aiming to allow them in scripts and let them
implicitly behave in the non-blocking way.

This PR remove NOSCRIPT flag from WAITAOF just like WAIT (to be
symmetrical)).
And this PR also add BLOCKING flag for WAIT and WAITAOF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants