{"action":"created","issue":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/471","repository_url":"https://api.github.com/repos/HangfireIO/Hangfire","labels_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/471/comments","events_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/471/events","html_url":"https://github.com/HangfireIO/Hangfire/issues/471","id":114807124,"number":471,"title":"Cannot release the application lock (Database Principal: 'public', Resource: 'locks:expirationmanager')","user":{"login":"willisterman","id":3006811,"avatar_url":"https://avatars.githubusercontent.com/u/3006811?v=3","gravatar_id":"","url":"https://api.github.com/users/willisterman","html_url":"https://github.com/willisterman","followers_url":"https://api.github.com/users/willisterman/followers","following_url":"https://api.github.com/users/willisterman/following{/other_user}","gists_url":"https://api.github.com/users/willisterman/gists{/gist_id}","starred_url":"https://api.github.com/users/willisterman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willisterman/subscriptions","organizations_url":"https://api.github.com/users/willisterman/orgs","repos_url":"https://api.github.com/users/willisterman/repos","events_url":"https://api.github.com/users/willisterman/events{/privacy}","received_events_url":"https://api.github.com/users/willisterman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HangfireIO/Hangfire/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/milestones/38","html_url":"https://github.com/HangfireIO/Hangfire/milestones/1.5.3","labels_url":"https://api.github.com/repos/HangfireIO/Hangfire/milestones/38/labels","id":1397992,"number":38,"title":"1.5.3","description":"","creator":{"login":"odinserj","id":1078718,"avatar_url":"https://avatars.githubusercontent.com/u/1078718?v=3","gravatar_id":"","url":"https://api.github.com/users/odinserj","html_url":"https://github.com/odinserj","followers_url":"https://api.github.com/users/odinserj/followers","following_url":"https://api.github.com/users/odinserj/following{/other_user}","gists_url":"https://api.github.com/users/odinserj/gists{/gist_id}","starred_url":"https://api.github.com/users/odinserj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odinserj/subscriptions","organizations_url":"https://api.github.com/users/odinserj/orgs","repos_url":"https://api.github.com/users/odinserj/repos","events_url":"https://api.github.com/users/odinserj/events{/privacy}","received_events_url":"https://api.github.com/users/odinserj/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"closed","created_at":"2015-11-06T16:38:34Z","updated_at":"2016-01-14T15:32:30Z","due_on":null,"closed_at":"2016-01-14T15:32:30Z"},"comments":10,"created_at":"2015-11-03T12:41:24Z","updated_at":"2016-04-26T14:43:03Z","closed_at":"2015-11-06T16:33:38Z","body":"I'm noticing the following error in our SQL Exception logging, about every 5 minutes:\r\n\r\nSystem.Data.SqlClient.SqlException (0x80131904): Cannot release the application lock (Database Principal: 'public', Resource: 'locks:expirationmanager') because it is not currently held.\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)\r\n   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n   at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader)\r\n   at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command)\r\n   at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType)\r\n   at Hangfire.SqlServer.SqlServerDistributedLock.Release(IDbConnection connection, String resource)\r\n   at Hangfire.SqlServer.ExpirationManager.<>c__DisplayClass4.<Execute>b__0(SqlConnection connection)\r\n   at Hangfire.SqlServer.SqlServerStorage.<>c__DisplayClassc.<UseConnection>b__b(SqlConnection connection)\r\n   at Hangfire.SqlServer.SqlServerStorage.UseConnection[T](Func`2 func)\r\n   at Hangfire.SqlServer.SqlServerStorage.UseConnection(Action`1 action)\r\n   at Hangfire.SqlServer.ExpirationManager.Execute(CancellationToken cancellationToken)\r\n   at Hangfire.Server.ServerProcessExtensions.Execute(IServerProcess process, BackgroundProcessContext context)\r\n   at Hangfire.Server.AutomaticRetryProcess.Execute(BackgroundProcessContext context)\r\n\r\nIt doesn't appear to be stopping hangfire from processing jobs, but it is filling up my error log!\r\n\r\nIt didn't appear to happen before 1.5.0, and I've tried both 1.5.0 and 1.5.2 with the same problems."},"comment":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/comments/214768242","html_url":"https://github.com/HangfireIO/Hangfire/issues/471#issuecomment-214768242","issue_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/471","id":214768242,"user":{"login":"robfarmergt","id":4447784,"avatar_url":"https://avatars.githubusercontent.com/u/4447784?v=3","gravatar_id":"","url":"https://api.github.com/users/robfarmergt","html_url":"https://github.com/robfarmergt","followers_url":"https://api.github.com/users/robfarmergt/followers","following_url":"https://api.github.com/users/robfarmergt/following{/other_user}","gists_url":"https://api.github.com/users/robfarmergt/gists{/gist_id}","starred_url":"https://api.github.com/users/robfarmergt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robfarmergt/subscriptions","organizations_url":"https://api.github.com/users/robfarmergt/orgs","repos_url":"https://api.github.com/users/robfarmergt/repos","events_url":"https://api.github.com/users/robfarmergt/events{/privacy}","received_events_url":"https://api.github.com/users/robfarmergt/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T14:43:03Z","updated_at":"2016-04-26T14:43:03Z","body":"I'm seeing this after upgrading to 1.5.4 too. Happening in an Azure SQL database. Is there a work around?"}}