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.

Stopping the server

See original GitHub issue

First and foremost: keep up the good work, i like where this project is going (:

I tried to implement an fs.watch logic that restarts oak on file change. For this I added the AbortController as mentioned in the README and I added controller.abort() to my fs.watch. Unfortunately neither the promise from app.listen was ever resolved, nor was the underlying server closed - it also seems like server.close() is not called in https://github.com/oakserver/oak/blob/master/application.ts#L226

Do I misunderstand the idea behind the AbortController? Or is this just not fully implemented?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
kitsonkcommented, May 17, 2020

Yes, sorry folks. I think I fixed it in 4bc2c76cad7e3ffed3725e29dedbbd0d5b7e3925. It was a situation where it needed to process another request to actually close the server. I had run into an issue where if you were processing middleware (like you abort in middleware) it caused all sorts of carnage, so I didn’t do that, but then it did mean that it wouldn’t see that close until too late. Now it tracks if it handling requests, and if it isn’t it will close, which should resolve the promise, otherwise it will finish any in flight requests before closing. I need a better test “mock” as my current one is limited, and giving me a false sense of fixing the problem.

0reactions
acrodrigcommented, Apr 14, 2021

Quick question on this topic: why not just have an app.close method? It could encapsulate the abort controller and make it easy/easier to use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stopping the server - IBM
When you issue the HALT command to stop the server, the following actions occur: All processes and client node sessions are canceled. All...
Read more >
Stop the server from the Windows command prompt
Stop the server from the Windows command prompt · Open another Windows command prompt. Click Start > Programs > Accessories > Command Prompt....
Read more >
Starting, stopping, and restarting Application Servers
To stop all Application Servers on the host · (Windows) Do one of the following: From the command line window where the Application...
Read more >
Starting and Stopping the Application Server
4. Depending on the server instance's state, click either the Start or Stop button to either start or stop the application server instance....
Read more >
server stop command :: Open Liberty Docs
The server stop command stops the named Open Liberty server. Normal server stop includes a quiesce stage before the server shuts down. This...
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