Allow LoadedLuaScript fail-over in case the Redis instance is restarted by martintmk · Pull Request #2170 · StackExchange/StackExchange.Redis
I've had a look at this, and: I think this PR is doing a great job of illustrating the problem, but I'm not sure it is the best direction for the solution. From what I can see, I think we can fix everything here much more simply and consistently, simply by changing LoadedLuaScript to pass ExecutableScript instead of Hash when calling db.ScriptEvaluate[Async](...) (around L268/L285); without any additional changes, I'm pretty sure we would run the lookup against the expected cache automatically, and I'm fine with paying a dictionary trygetvalue for simpler code.
(as a side note: if we did that, we should probably mark the the exposed byte[] Hash as hidden via the usual attributes, and update the remarks; actually, this array is a mild risk currently - it is mutable and prone to abuse)
There is a pre-existing inconsistency between the sync and async versions of ScriptEvaluate[Async](string, ...), and honestly: I think we should just eat the async/await here, and make the code consistent - i.e. reinstate the try/catch (and detect missing script) from the sync version into the async version.
Thoughts?