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.

windowTime race condition

See original GitHub issue

Bug Report

Current Behavior windowTime for some parameter values throws

Error in /turbo_modules/rxjs@6.5.2/internal/operators/windowTime.js (105:27)
Cannot read property 'closed' of undefined

Couldn’t figure out the exact relation between parameters, but basically it reliably broke for me with windowTimeSpan > windowCreationInterval && maxWindowSize > 2,

Reproduction https://stackblitz.com/edit/rxjs-gajdpw?devtoolsheight=60

import { interval } from 'rxjs';
import { windowTime, mergeAll } from 'rxjs/operators';

const timer = interval(200)
const result = timer.pipe(
  windowTime(1000, 600, 4),
  mergeAll(),
);
result.subscribe(x => console.log(x));

Expected behavior Not breaking. Not sure as to exact console output, though. Same as with bufferTime? I am pretty new to RxJS, just experimenting with operators.

Environment

  • Runtime: Chrome 76.0.3806.1 (Official Build) dev (64-bit)
  • RxJS version: 6.5.2

Additional context/Screenshots I’m assuming windowTime tries to close a window stream before it creates one, so a race condition?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kschaefecommented, Nov 14, 2019

As the original reporter suggested, I can confirm that bufferTime is dropping events when you are using positive values for all three parameters. Do you need a different issue report for that?

0reactions
cartantcommented, Nov 15, 2019

@kschaefe

Do you need a different issue report for that?

I’ve not been able to reproduce this easily with bufferTime, so if you could open another issue - complete with a minimal reproduction - that would be appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tacopie thread_pool class variable m_nb_running_threads should ...
... m_nb_runing_threads variable to protect it from race condition? each thread of the worker pool w. ... there is a 'window time' between...
Read more >
How to avoid race condition between `addEventListener` and ...
There shouldn't be a race condition here, because the window.open and window.addEventListener occur together in the same tick, ...
Read more >
Fix race-condition when reading sysfs attributes. - Patchwork
This fix re-introduces a wait loop when reading sysfs attributes. The reason a wait is necessary is due to the way the kernel...
Read more >
[lwip-devel] [bug #50837] LWIP TCP/IP race condition
[lwip-devel] [bug #50837] LWIP TCP/IP race condition ... After all, the zerow window time shown in the pcap is "only" a little less...
Read more >
The RACE Condition window was automatically opened as ...
The RACE Condition window was automatically opened as soon as such a condition was detected; the other window concerns predicate detection (a synthetic ......
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