locked
Duplicate call to a hub. RRS feed

  • Question

  • User1382124218 posted

    I am doing one call to a hub with specified argument that is cleaned right after call:

    $.connection.hub.start({ jsonp: true }).done(function () {
         var hubDataId = dataId;
         myHub.server.doJob(hubDataId);
         dataId = '';
    });

    Often on a server with a load balancer I get duplicate call to the hub with the same hubDataId.

    In most cases the duplicate call is executed exactly 10 minutes after the first call. In other cases they are executed almost simultaneously.

    How can I stop these arbitrary duplicate calls?

    I am using SignalR 1.1.4.

    Friday, November 18, 2016 2:35 PM

All replies

  • User1283705980 posted

    Hi,

    I couldn't understand how your codes works.

    In most cases the duplicate call is executed exactly 10 minutes after the first call. In other cases they are executed almost simultaneously.

    What is this line mean?

    Monday, November 21, 2016 12:42 PM
  • User1382124218 posted

    Hi,

    It is not full code, it is just a part that shows how request to the hub is made. What problem do you have with understanding this code?

    myHub.server.doJob(hubDataId);

    This line makes request to the hub and ask him to execute "doJob" method with hubDataId parameter. This line is executed one time but hubs "doJob" method is often executed twice.

    Monday, November 21, 2016 3:11 PM
  • User1104055534 posted

    Is there any fixed pattern of this issue happening? the issue would always repro under every call of this function?

    for troubleshooting, I would suggest to capture some network trace to figure out the procedure, how many function calls are sent by client every time? how many functions called are received by server? if possible ,maybe you could try to bypass NLB to see if the issue still exists.

    https://www.asp.net/signalr/overview/getting-started/introduction-to-signalr

    https://www.asp.net/signalr/overview/older-versions/troubleshooting

    Friday, November 25, 2016 3:45 AM
  • User1382124218 posted

    I failed to reproduce this on a development server but on a production it occurs few times per day on a long running server job.

    Client does one call to a hub and waits for a status response from the hub. The response is received mostly in a few seconds intervals until the hub finish his job.

    Request logs are the following:

    16:35:09|/signalr/hubs/connect?transport=longPolling&connectionToken=7y1...
    16:35:09|/signalr/hubs/send?transport=longPolling&connectionToken=7y1...
    16:35:12|/signalr/hubs/poll?transport=longPolling&connectionToken=7y1...
    ... a lot of poll requests...
    16:45:08|/signalr/hubs/poll?transport=longPolling&connectionToken=7y1...
    16:45:09|/signalr/hubs/send?transport=longPolling&connectionToken=7y1...
    16:45:09|/signalr/hubs/poll?transport=longPolling&connectionToken=7y1...

    Monday, November 28, 2016 2:21 PM