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.

Simultaneous writing are skipped (3 and more)

See original GitHub issue

Hello,

I have an issue with an express API when multiples request are processed in the same time, there are not all logged (rotating-file-stream: 2.1.4).

Here is a sample code:

  const accessLogStream2 = rfs.createStream('access-test.log', {
    interval: '1d',
    path: path.join(__dirname, 'log'),
    teeToStdout: true,
  })

  api.use((req, res, next) => {
    console.log(`console ${Date.now()} ** ${req.url}`)
    accessLogStream2.write(`rfs ${Date.now()} ** ${req.url}\n`)
    next()
  })

And here is the output:

console 1612715099666 ** /api/states?module=srm&logicalId=devices
console 1612715099667 ** /api/states?module=srm&logicalId=eth0-upload
console 1612715099669 ** /api/states?module=srm&logicalId=lbr0-upload
console 1612715099670 ** /api/states?module=srm&logicalId=eth0-download
console 1612715099671 ** /api/states?module=srm&logicalId=lbr0-download
rfs 1612715099666 ** /api/states?module=srm&logicalId=devices
rfs 1612715099667 ** /api/states?module=srm&logicalId=eth0-upload
...
console 1612715099691 ** /api/states/165
console 1612715099692 ** /api/states/168
console 1612715099692 ** /api/states/166
console 1612715099693 ** /api/states/169
console 1612715099694 ** /api/states/167
rfs 1612715099691 ** /api/states/165
rfs 1612715099692 ** /api/states/168

It seems that only 2 logs are logged 😞 Any idea?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
icciccicommented, Feb 19, 2021

It seems the problem is with Node.js v14, using it I have the same problem. On v12 the script works as expected. I’ll try to fix this

0reactions
nioccommented, Feb 19, 2021

Thanks @iccicci, seems to be fixed 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enabling or disabling simultaneous write protection provided ...
This prevents more than one virtual machine from inadvertently accessing the same .vmdk file. The multi-writer option allows VMFS-backed ...
Read more >
Why is Scanner skipping nextLine() after use of other next ...
The nextLine() method of java.util.Scanner class advances this scanner past the current line and returns the input that was skipped.
Read more >
Why doesn't exist not concurrent version of SkipList
I have described a set of algorithms that allow multiple pro- cessors to concurrently update a skip list in shared memory [Pug89a]. This ......
Read more >
IT15468: "ANR3247W" CAUSED BY ABORT OF A BACKUP ...
Warning message: ANR3247W Process 1234 skipped 1 files on volume. ... scenario: The client is performing a backup using simultaneous write of a...
Read more >
Modeling Dual Read/Write Paths for Simultaneous Machine ...
In this paper, we propose a method of dual-path SiMT which introduces duality constraints to direct the read/write path. According to duality ...
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