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

server: Add Windows console control handler #945

Merged
merged 13 commits into from
Jun 9, 2023

Conversation

bkeryan
Copy link
Contributor

@bkeryan bkeryan commented May 30, 2023

What does this Pull Request accomplish?

Add a Windows console control handler. This enables the server to shut down cleanly on Windows, in some circumstances.

Note In Task Manager, selecting End task for the ni_grpc_device_server.exe process or the MeasurementLink discovery service process does not seem to shut down the server cleanly. I'm not sure whether using a hidden window to listen for WM_CLOSE would help.

Why should this Pull Request be merged?

This is optional part 5 of a fix for #936

What testing has been done?

Manually tested ctrl-C, closing console window, and selecting End task in Task Manager.

bkeryan added 12 commits May 30, 2023 16:15
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
…g else

Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
The service class retains a shared_ptr to the library class, so there is
no longer a need to manage both with a single shared_ptr.

Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Base automatically changed from users/bkeryan/clean-shutdown-4 to main June 9, 2023 14:05
@bkeryan
Copy link
Contributor Author

bkeryan commented Jun 9, 2023

This system test timeout is unrelated to this PR, since the system tests do not exercise core_server.cpp

Fri, 09 Jun 2023 15:45:30 GMT
Run .\SystemTestsRunner.exe
Fri, 09 Jun 2023 15:[4](https://github.com/ni/grpc-device/actions/runs/5222830485/jobs/9430650506?pr=945#step:4:5)5:34 GMT
[==========] Running 591 tests from 58 test suites.
...
Fri, 09 Jun 2023 16:12:22 GMT
[ RUN      ] IndependentResourceInitTestCases/NiRFmxSpecAnDriverApiIndependentResourceInitTests.InitializeTwoSessionsWithDifferentResources_ForceCloseOne_OtherIsStillValid/specan1_specan2__specan3_specan4
Fri, 09 Jun 2023 16:12:46 GMT
Error: The action has timed out.

@bkeryan bkeryan merged commit e78f7d0 into main Jun 9, 2023
@bkeryan bkeryan deleted the users/bkeryan/clean-shutdown-5 branch June 9, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants