Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Server is killed and doesn't come back up when saving changes #11719

Open
1 task
o0charlie0o opened this issue Nov 15, 2024 · 1 comment · May be fixed by #11731
Open
1 task

[Bug?]: Server is killed and doesn't come back up when saving changes #11719

o0charlie0o opened this issue Nov 15, 2024 · 1 comment · May be fixed by #11731
Labels
bug/needs-info More information is needed for reproduction

Comments

@o0charlie0o
Copy link
Contributor

o0charlie0o commented Nov 15, 2024

What's not working?

When the server restarts after making a code change it is killed and doesn't come back up. After some investigation it appears to have been introduced with this pr: #11691

Essentially if the first promise wins then it resolves and await this.startApiServer() is called. The problem here is the second promise still executes so after 2 seconds it still kills the server anyways.

Running the following code in chrome dev tools console will demonstrate the issue:

const promise1 = new Promise((resolve) => {
  setTimeout(() => {
    console.log('Promise 1 resolved');
    resolve('First');
  }, 100);
});

const promise2 = new Promise((resolve) => {
  setTimeout(() => {
    console.log('Promise 2 resolved');
    resolve('Second');
  }, 200);
});

Promise.race([promise1, promise2]).then((value) => {
  console.log('Race settled with:', value);
});

Output is:
Promise 1 resolved
Race settled with: First
Promise 2 resolved

How do we reproduce the bug?

Make a change in some code on the api side and save so the server restarts

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this
@o0charlie0o o0charlie0o added the bug/needs-info More information is needed for reproduction label Nov 15, 2024
@s98berg
Copy link

s98berg commented Nov 20, 2024

After upgrading to 8.4.1 the same thing happens in my project that if I edit in the api the server shuts down and doesn't start again. I use vscode on mac. Really glad I found the bug report here, because I've spent hours debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants