question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

double multicast causes skipping first event

See original GitHub issue

Hey @briancavalier!

My old vague bug report: I’ve been chasing down a problem in our app, that seems to be an issue with `multicast`. I’m having a hard time reducing it down to a minimal case and thought I could give you at least a hint, that something is not working as it should.

The bug I see is that adding multicast to a stream subscribed by multiple consumers results in the source stream not emitting the first initial event for some of them. This leads to our app not initialising correctly. Removing multicast fixes the issue, but since it has multiple consumers it should use it, but not break.

I’ve tried replacing the producer with just and the issue still occurred. The minimal case I could nail it down to for now is having three consumers where the last one is not receiving the initial event. The one not receiving the event is a combination of combine and startWith. Removing startWith fixes the bug. Removing one of the other two streams or adding another consumer fixes the bug as well. One of them samples the producer and some other streams. Removing a stream there also fixes the bug.

As you can see it’s hard to find the root cause, since it feels quite arbitrary what causes the issue.

Maybe you already have any idea what the problem might be. I’ll keep trying to reproduce it to a minimal example.


Update: I could boil it down to a minimum:

const most = require('most');

const producer = most.just().multicast();

const working = most.combine(() => 0, producer).multicast();
const broken = most.combine(() => 2, producer).startWith(1);

working.forEach(value => document.write('working: ' + value + '<br>'));

// expected: brokenConsumer should emit 1 and 2
broken.forEach(value => document.write('broken: ' + value + '<br>'));

// removing one of the multicasts fixes the bug
// removing startWith emits 2

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
axefrogcommented, Nov 24, 2016

At the risk of unintentionally coming across as one of those smarmy “RTFM” types, I do suggest reading the architecture wiki page, as it’s quite helpful in building an idea of how Most works under the hood. I also suggest perusing some of the code; the design has an elegant but powerful simplicity, and once you understand how it works, you’ll be able to troubleshoot most problems fairly quickly.

I also think it’s an extremely useful exercise to have a go at building a simple producer or combinator. It’s relatively easy, and will help you internalise a much firmer understanding of the library’s inner workings.

0reactions
maxhoffmanncommented, Nov 24, 2016

Ok thank, will take a look. 👍 Closing this one then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Multicast Traffic Issues in Same VLAN on Catalyst Switches
This document describes how to fix a multicast application failure when it is deployed in the same VLAN between Catalyst switches.
Read more >
Troubleshooting Multicast - Arista Community Central
1) Multicast Bridging. (i) Multicast traffic not received by the subscriber; (ii)Multicast traffic is flooded within a VLAN · 2) Multicast ...
Read more >
Configuring and Troubleshooting Multicast Protocols
There are two important protocols required to configure multicast network packet forwarding. Here's how to configure & troubleshoot them.
Read more >
Introduction to Multicast - NetworkLessons.com
In this lesson we'll take a look at the basics of multicast. You will learn what multicast is, how it works and the...
Read more >
You think you've got multicast storms now? Just wait for 10 GigE!
Back in the early days of market data systems, 10 MbE networks were the standard. ... There are two common causes of multicast...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found