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

Add warning when windows defender delays supernova boot #4984

Conversation

geoffroymontel
Copy link
Contributor

Purpose and Motivation

This is the followup to #4941 (thanks for guiding me @brianlheim).

It displays a warning message for Windows users when supernova takes longer than 10 seconds to boot, which may come from Windows Defender scanning all the UGens.

Manually tested :
[X] Message is displayed if supernova takes more than 10 seconds to boot
[X] Message is not displayed if supernova takes less than 10 seconds to boot
[X] Message is displayed if scsynth takes more than 10 seconds to boot
[X] Message is not displayed if scsynth takes less than 10 seconds to boot

Types of changes

  • New feature

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

Please squash the commits if you merge this PR !

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! just a few changes.

@@ -0,0 +1,2 @@
void startServerBootDelayWarningTimer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add #pragma once to the top of this file, and move the comment from the top of the cpp file to this file instead. header files are typically the place where API documentation goes. you could also add a quick note about how these two calls are used if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks !

static bool g_isServerBooted = false;
static std::mutex g_scsynthBootWarningMutex;
static std::condition_variable g_scsynthBootWarningConditionVariable;
static std::thread* g_bootWarningThread;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be a std::thread -- the default constructor (number 1 here) doesn't start a real thread of execution. then you can assign to it with g_bootWarningThread = std::thread(...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in modern C++ (C++11 and newer), using new and delete directly is almost always a bad sign. there are several ways of avoiding it -- unique_ptr and shared_ptr among them -- that are not only semantically clearer, but also safer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! I had not read the section about "utilities" in "A tour of C++" yet. A lot of things have changed (in a good way) since my old days in C++ :)


static bool g_isServerBooted = false;
static std::mutex g_scsynthBootWarningMutex;
static std::condition_variable g_scsynthBootWarningConditionVariable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything using scsynth in its name should now use server instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah of course !

std::cout << "On some Windows-based machines, Windows Defender sometimes ";
std::cout << "delays server boot by one minute." << std::endl;
std::cout << "You can add scsynth.exe and/or supernova.exe *processes* to ";
std::cout << "Windows Defender exclusion list to disable this check. It's safe." << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider changing disable this check to avoid this delay -- it's unclear what this check refers to, and because of that, not entirely clear that disabling it means that the delay will go away.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea !

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mossheim mossheim merged commit ac7c0c0 into supercollider:develop Jun 1, 2020
@geoffroymontel geoffroymontel deleted the topic/add-warning-when-windows-defender-delays-supernova-boot branch June 1, 2020 15:41
patrickdupuis pushed a commit to patrickdupuis/supercollider that referenced this pull request Jul 12, 2020
…r#4984)

* add warning when supernova boot is delayed by Windows Defender, follow up to supercollider#4941

* temporarily enable appveyor artifacts to test on windows

* trying endl instead of \n

* remove artifacts generation from appveyor

* various changes after Brian's code review
@patrickdupuis patrickdupuis mentioned this pull request Jul 12, 2020
4 tasks
@patrickdupuis patrickdupuis moved this from TODO to in progress in Patch release cherry-picks Jul 12, 2020
mossheim added a commit that referenced this pull request Jul 12, 2020
@patrickdupuis patrickdupuis moved this from in progress to DONE in Patch release cherry-picks Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants