StackExchange / StackExchange/StackExchange.Redis

ConnectTimeout exception doesn't respect IncludeDetailInExceptions=false

Open
#2,949 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

I was experimenting with StackExchange.Redis a bit, where at some point I tried to send a query while local redis was down and got an exception with this message:

The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: It was not possible to connect to the redis server(s) localhost:6379/Interactive. Error connecting right now. To allow this multiplexer to continue retrying until it's able to connect, use abortConnect=false in your connection string or AbortOnConnectFail=false; in your code. ConnectTimeout, command=SET, timeout: 5000, inst: 0, qu: 0, qs: 0, aw: False, bw: CheckingForTimeout, rs: NotStarted, ws: Idle, in: 0, last-in: 0, cur-in: 0, sync-ops: 2, async-ops: 129, serverEndpoint: localhost:6379, conn-sec: n/a, aoc: 1, mc: 1/1/0, mgr: 10 of 10 available, clientName: Some-PC(SE.Redis-v2.9.11.19757), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=32765,Min=24,Max=32767), POOL: (Threads=5,QueuedItems=0,CompletedItems=2864,Timers=8), v: 2.9.11.19757 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)\r\nIt was not possible to connect to the redis server(s) localhost:6379/Interactive. Error connecting right now. To allow this multiplexer to continue retrying until it's able to connect, use abortConnect=false in your connection string or AbortOnConnectFail=false; in your code. ConnectTimeout

While it's definitely nice and informative, the problem is that I had ConfigurationOptions.IncludeDetailInExceptions set to false, yet I still got pretty much everything, including the server address and a few metrics. Do you think it makes sense to not include common details, like it's done for NoConnectionAvailable exception?

In addition, it seems like ConfigurationOptions.IncludePerformanceCountersInExceptions is completely ignored whatsoever.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing ConnectTimeout exception creation and how ConfigurationOptions.IncludeDetailInExceptions and IncludePerformanceCountersInExceptions are consulted. Add regression coverage for disabled detail and performance settings, then verify that the resulting exception no longer exposes the details and metrics described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.