NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

SecondLevelRetries.Disabled does not reflect when feature has been disabled

Open JustinThirkell opened this issue 13 years ago • 2 comments

Expected

When SecondLevelRetries feature is disabled the satellite should not be started up.

Observed

version: 4.0.2 logging output shows that the timeoutmanager and secondlevelretries are both disabled, however the satellitelauncher is starting up the secondlevelretriesprocessor... image

Details

The SatelliteLauncher only launches satellites as follows:

    var satellitesList = Configure.Instance.Builder
                                          .BuildAll<ISatellite>()
                                          .ToList()
                                          .Where(s => !s.Disabled)
                                          .ToList();

The implementation of TimeoutDispatcherProcessor is:

        public bool Disabled
        {
            get { return !Feature.IsEnabled<TimeoutManager>(); }
        }

Whereas the implementation of SecondLevelRetriesProcessor is:

        public bool Disabled { get; set; }

JustinThirkell avatar Sep 04 '13 23:09 JustinThirkell

If you look at the comment in the code here, it explains how it works.

johnsimons avatar Sep 04 '13 23:09 johnsimons

sorry, I still don't understand.

if I understand correctly, the SLR satellite is always turned on regardless of feature being disabled. (that really is a bit confusing). But if SLR is disabled then at runtime, when the SLR would otherwise handle a failed msg it just pushes the msg straight to the error queue. Right?

the thing is, there is no usage I can find of the setter for SecondLevelRetriesProcessor.Disabled. So when would this code block ever be entered?

 if (Disabled)
            {
                Logger.DebugFormat("The SecondLevelRetries satellite is invoked, but disabled. Sending message to error queue. Make sure that this behavior is expected!");
                SendToErrorQueue(message);
                return true;
            }

JustinThirkell avatar Sep 05 '13 00:09 JustinThirkell