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.

Race condition between file reset and i18n initialization [๐Ÿ›]

See original GitHub issue

๐Ÿ› Bug report

Description

The function lib/startup/restoreOverwrittenFilesWithOriginals (called in server.js early on) copies the i18n locale files into the folder /i18n where they are expected to exist by the i18n.configure call (later in server.js) or later, particularly when it tries to do auto-reloading whenever a locale file changes, which might be triggered by the still ongoing copy job.

Smells like a race condition. Affects test runs frequently but also regular server starts sometimes.

Is this a regression?

Present since i18n with auto-reloading was introduced, but it seems to occur more often recently.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
adityaofficial10commented, Feb 21, 2021

@bkimminich Yeah sureโ€ฆ I was thinking on the same lines. Should I go ahead with the PR?

1reaction
bkimminichcommented, Feb 21, 2021

Looks good to me, gotta test it next week.

Maybe @J12934 can also take a look b/c heโ€™s our official async-await-expertโ€ฆ ๐Ÿ˜ Btw, does this change affect server start-up time calculation? ๐Ÿงฎ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Race condition between file reset and i18n initialization [๐Ÿ›]
The function lib/startup/restoreOverwrittenFilesWithOriginals (called in server.js early on) copies the i18n locale files into the folder /i18n ...
Read more >
[deleted] - Profile - Bountysource
[deleted] commented on this issueRace condition between file reset and i18n initialization [๐Ÿ›] . juice-shop 1 year ago.
Read more >
A new approach to detect potential race conditions in ...
paper, we focus on such a specific requirement: race conditions issues in component-based systems. We present a heuristic that.
Read more >
3.7 Race Conditions - FreeBSD Documentation
A race condition is anomalous behavior caused by the unexpected dependence on the relative timing of events. In other words, a programmer incorrectlyย ......
Read more >
next.js - Handle file changes with i18next - Stack Overflow
I'm using next.js with i18n and when I initialize my i18n.js , I'm loading the files with the translations files this way:
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