I am seeing records never leaving the Enqueued state in the Job table.
I am using MSMQ. I have a log entry that is being written write before the method exits, but I the state is never updated.
I turned on the journal in the queue. I see that it get pulled off the queue.
Here are all the SQL statements processed for this job in the order they were executed.
exec sp_executesql N'
insert into HangFire.Job (InvocationData, Arguments, CreatedAt, ExpireAt)
values (@invocationData, @arguments, @createdAt, @expireAt);
SELECT CAST(SCOPE_IDENTITY() as int)',N'@invocationData nvarchar(4000),@arguments nvarchar(4000),@createdAt datetime,@expireAt datetime',@invocationData=N'{"Type":"NLS.Api.Assets.Analyzer.IPowerDeviceDerivationService, nls.api.asset, Version=3.2.1.0, Culture=neutral, PublicKeyToken=null","Method":"ProcessByPowerAssetSafely","ParameterTypes":"[\"System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\"]","Arguments":"[\"\\\"767363fe-9aa1-e411-8457-00090ffe0001\\\"\"]"}',@arguments=N'["\"767363fe-9aa1-e411-8457-00090ffe0001\""]',@createdAt='2015-01-22 06:08:28.143',@expireAt='2015-01-22 07:08:28.143'
exec sp_executesql N'
insert into HangFire.JobParameter (JobId, Name, Value)
values (@jobId, @name, @value)',N'@jobId nvarchar(4000),@name nvarchar(4000),@value nvarchar(4000)',@jobId=N'12',@name=N'CurrentCulture',@value=N'"en-US"'
exec sp_executesql N'
insert into HangFire.JobParameter (JobId, Name, Value)
values (@jobId, @name, @value)',N'@jobId nvarchar(4000),@name nvarchar(4000),@value nvarchar(4000)',@jobId=N'12',@name=N'CurrentUICulture',@value=N'"en-US"'
exec sp_executesql N'
insert into HangFire.State (JobId, Name, Reason, CreatedAt, Data)
values (@jobId, @name, @reason, @createdAt, @data);
update HangFire.Job set StateId = SCOPE_IDENTITY(), StateName = @name where Id = @id;',N'@jobId nvarchar(4000),@name nvarchar(4000),@reason nvarchar(4000),@createdAt datetime,@data nvarchar(4000),@id nvarchar(4000)',@jobId=N'12',@name=N'Enqueued',@reason=NULL,@createdAt='2015-01-22 06:08:28.147',@data=N'{"EnqueuedAt":"2015-01-22T06:08:28.1435488Z","Queue":"default"}',@id=N'12'
exec sp_executesql N'update HangFire.Job set ExpireAt = NULL where Id = @id',N'@id nvarchar(4000)',@id=N'12'
exec sp_executesql N'select InvocationData, StateName, Arguments, CreatedAt from HangFire.Job where Id = @id',N'@id nvarchar(4000)',@id=N'12'