windowTime race condition
See original GitHub issueBug 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:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

As the original reporter suggested, I can confirm that
bufferTimeis dropping events when you are using positive values for all three parameters. Do you need a different issue report for that?@kschaefe
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.