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

MSIE/Win7: mongoose webserver hangs for about 30s after application was closed #61

Closed
GoogleCodeExporter opened this issue Aug 28, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

stoppping Mongoose webserver freezes for about 30 seconds on Win7. This does 
not happen in phpdesktop-chrome that uses exact same version of Mongoose. 
Fortunately, the freezing happens after the application window was closed, so 
this problem is not visible to end user. Only that the phpdesktop-msie.exe 
process still hangs in Task Manager. This could be an issue if 
"single_instanace_application" is set in settings.json file and user tries to 
launch application once again, after he closed it just several seconds ago. 
This issue must have something to do with the MSIE web control. Maybe it is 
caused by the call to CoInitialize() that identifies the concurrency model as 
single-thread apartment?

Original issue reported on code.google.com by czarek.t...@gmail.com on 22 Jan 2014 at 11:21

@GoogleCodeExporter
Copy link
Author

This is happening randomly, depepnding on the content being served by the 
webserver. If I just load only index.php and close app it hangs. If I navigate 
to some other script and close app, then it doesn't hang. In some other 
scenario with two some other scripts being run, it hangs again.

Original comment by czarek.t...@gmail.com on 22 Jan 2014 at 11:27

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

It seems that the IE webbrowser control does not free IO channel resources 
properly, or does it delayed. There is this sleep call in mongoose when 
stopping webserver:

  ctx->stop_flag = 1;
  // Wait until mg_fini() stops
  while (ctx->stop_flag != 2) {
    (void) mg_sleep(10);
  }
  free_context(ctx);

Let's investigate if there is a way to stop mongoose immediately without the 
calls to mg_sleep().

Original comment by czarek.t...@gmail.com on 22 Jan 2014 at 11:37

@GoogleCodeExporter
Copy link
Author

It seems that when application quits it shouldn't matter if mongoose resources 
are released, thus we could fix the problem and quit app immediately without 
the call to mg_stop(). See this post by Sergey Lyubka:

https://groups.google.com/d/msg/mongoose-users/qLNrY6asGms/zGC-rIHMO5oJ

We could introduce a new parameter to the mg_stop(bool quit_immediately=false) 
function.

Original comment by czarek.t...@gmail.com on 22 Jan 2014 at 11:46

@GoogleCodeExporter
Copy link
Author

Fixed in revision 1f8c53d45df4.

Original comment by czarek.t...@gmail.com on 22 Jan 2014 at 12:13

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Project will move to Github. Find this issue at the new address (soon): 
https://github.com/cztomczak/phpdesktop/issues/61

Original comment by czarek.t...@gmail.com on 24 Aug 2015 at 3:23

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

No branches or pull requests

1 participant