Closed
Description
- Version: 8.0.0, master
- Platform: Linux samtu 4.8.0-53-generic fs: fix fd leak in ReadStream.destroy() #56-Ubuntu SMP Tue May 16 00:23:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: timers
Perhaps I expect too much, but I expect a sequence of
setTimeout(100, a)
setTimeout(100, b)
to always call a
before b
, but this doesn't happen. I was looking at this because @hhellyer pointed out that unrefed and refed timers use different timer handles (expected), so I looked, and see that they are in two lists, however, the lists are internally designed so that new callbacks for the same time are appended to a list, guaranteeing order, but it isn't clear that those ordering guarantees are maintained across refed and unrefed timers, since they use different lists.
Or, perhaps I'm seeing an artifact of timer accuracy?
@Fishrock123 @mscdex You two seem familiar with the timers, what do you think, is this a problem?
_.js
function F(s) {
return () => console.log(s);
}
setTimeout(F('A'), 100)
setTimeout(F('B'), 100).unref()
setTimeout(F('C'), 100)
setTimeout(F('D'), 100).unref()
Output:
% ./node -v
v9.0.0-pre
% ./node _.js
A
C
B
D
% node -v
v8.0.0
% node _.js
A
B
D
C
% node _.js
A
C
B
D
% node _.js
A
C
B
D
core/node (check-is-listening $%) % node -v
v8.0.0