Skip to content

NullReferenceException in MySqlConnector.Utilities.TimerQueue.Callback #1177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
csandr opened this issue May 31, 2022 · 2 comments
Closed

NullReferenceException in MySqlConnector.Utilities.TimerQueue.Callback #1177

csandr opened this issue May 31, 2022 · 2 comments
Labels

Comments

@csandr
Copy link

csandr commented May 31, 2022

Software versions
MySqlConnector version: 2.1.9
CoreCLR Version: 6.0.522.21309
.NET Version: 6.0.5

Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException: Object reference not set to an instance of an object.
   at MySqlConnector.MySqlConnection.Cancel(ICancellableCommand command, Int32 commandId, Boolean isCancel) in /_/src/MySqlConnector/MySqlConnection.cs:line 780
   at MySqlConnector.MySqlCommand.CancelCommandForTimeout() in /_/src/MySqlConnector/MySqlCommand.cs:line 424
   at MySqlConnector.Utilities.TimerQueue.Callback(Object obj) in /_/src/MySqlConnector/Utilities/TimerQueue.cs:line 92
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()

Link to the exception line

Last second logs

MySqlConnector.CommandExecutor:

04:06:00.2176 Trace Session1.225 ExecuteReader Synchronous CommandCount: 1 
04:06:01.3484 Trace Session1.225 ExecuteReader Synchronous CommandCount: 1 
04:06:02.5396 Trace Session1.225 ExecuteReader Synchronous CommandCount: 1 
04:06:02.6449 Trace Session1.226 ExecuteReader Synchronous CommandCount: 1 
04:06:02.9968 Trace Session1.225 ExecuteReader Synchronous CommandCount: 1 
04:06:03.1121 Trace Session1.226 ExecuteReader Synchronous CommandCount: 1 

MySqlConnector.ConnectionPool

04:06:00.1477 Trace Pool1 receiving Session1.226 back 
04:06:00.2176 Trace Pool1 returning pooled Session1.225 to caller; LeasedSessionsCount=2 
04:06:00.4365 Trace Pool1 receiving Session1.225 back 
04:06:01.1205 Trace Pool1 waiting for an available session 
04:06:01.1205 Trace Pool1 found an existing session; checking it for validity 
04:06:01.3484 Trace Pool1 returning pooled Session1.225 to caller; LeasedSessionsCount=2 
04:06:01.5743 Trace Pool1 receiving Session1.225 back 
04:06:02.3118 Trace Pool1 waiting for an available session 
04:06:02.3118 Trace Pool1 found an existing session; checking it for validity 
04:06:02.4194 Trace Pool1 waiting for an available session 
04:06:02.4194 Trace Pool1 found an existing session; checking it for validity 
04:06:02.5107 Trace Pool1 receiving Session1.224 back 
04:06:02.5107 Info Pool1 received invalid Session1.224; destroying it 
04:06:02.5396 Trace Pool1 returning pooled Session1.225 to caller; LeasedSessionsCount=1 
04:06:02.6449 Trace Pool1 returning pooled Session1.226 to caller; LeasedSessionsCount=2 
04:06:02.7658 Trace Pool1 receiving Session1.225 back 
04:06:02.7658 Trace Pool1 waiting for an available session 
04:06:02.7658 Trace Pool1 found an existing session; checking it for validity 
04:06:02.8706 Trace Pool1 receiving Session1.226 back 
04:06:02.8706 Trace Pool1 waiting for an available session 
04:06:02.8706 Trace Pool1 found an existing session; checking it for validity 
04:06:02.9968 Trace Pool1 returning pooled Session1.225 to caller; LeasedSessionsCount=1 
04:06:03.1121 Trace Pool1 returning pooled Session1.226 to caller; LeasedSessionsCount=2 
04:06:10.1245 Trace Pool1 receiving Session1.226 back 
04:06:10.1245 Trace Pool1 receiving Session1.225 back 
04:06:10.1245 Trace Pool1 waiting for an available session 
04:06:10.1245 Trace Pool1 found an existing session; checking it for validity 

MySqlConnector.MySqlConnection

04:06:01.4547 Debug CommandId 24104 for Session1.224 has been canceled via command timeout. 
04:06:01.4547 Debug Created new non-pooled Session0.

MySqlConnector.ServerSession
https://pastebin.com/KVqPzCPb

@Graf2233
Copy link

MySqlConnector version: 2.1.10
CoreCLR Version: 6.0.522.21309
.NET Version: 6.0.5

Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException: Object reference not set to an instance of an object.
at MySqlConnector.MySqlConnection.Cancel(ICancellableCommand command, Int32 commandId, Boolean isCancel) in //src/MySqlConnector/MySqlConnection.cs:line 780
at MySqlConnector.MySqlCommand.CancelCommandForTimeout() in /
/src/MySqlConnector/MySqlCommand.cs:line 424
at MySqlConnector.Utilities.TimerQueue.Callback(Object obj) in /_/src/MySqlConnector/Utilities/TimerQueue.cs:line 92
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
at System.Threading.TimerQueue.FireNextTimers()

@bgrainger
Copy link
Member

Fixed in 2.1.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants