Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/StackExchange.Redis/PhysicalBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,15 +1200,20 @@ private WriteResult WriteMessageToServerInsideWriteLock(PhysicalConnection conne

if (!connection.TransactionActive)
{
var readmode = connection.GetReadModeCommand(isMasterOnly);
if (readmode != null)
// If we are executing AUTH, it means we are still unauthenticated
// Setting READONLY before AUTH always fails but we think it succeeded since
// we run it as Fire and Forget.
if (cmd != RedisCommand.AUTH)
{
connection.EnqueueInsideWriteLock(readmode);
readmode.WriteTo(connection);
readmode.SetRequestSent();
IncrementOpCount();
var readmode = connection.GetReadModeCommand(isMasterOnly);
if (readmode != null)
{
connection.EnqueueInsideWriteLock(readmode);
readmode.WriteTo(connection);
readmode.SetRequestSent();
IncrementOpCount();
}
}

if (message.IsAsking)
{
var asking = ReusableAskingCommand;
Expand Down