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 started from Windows Explorer blocks on input #850

Closed
lmoureaux opened this issue Jan 26, 2022 · 6 comments · Fixed by #907
Closed

Server started from Windows Explorer blocks on input #850

lmoureaux opened this issue Jan 26, 2022 · 6 comments · Fixed by #907
Labels
bug Something isn't working server This issue requires changes to the server
Milestone

Comments

@lmoureaux
Copy link
Contributor

lmoureaux commented Jan 26, 2022

Describe the bug

Apparently we still have this bug.

To Reproduce
Steps to reproduce the behavior:

  1. Start a server from Windows Explorer
  2. Start a client, go to network page
  3. Don't see your server
  4. Go to server window, hit a key
  5. Go back to client, see your server listed
  6. Try to connect, seems to block
  7. Go to server window, hit a key
  8. Connect unblocks

Expected behavior

Client seamlessly detects the server and connects.

Platform and version (please complete the following information):

  • OS: Windows 10
  • Freeciv21 version: 3.0-alpha9

Additional context

The server event loop is blocked waiting for input on stdin. Move input to a thread.

@lmoureaux lmoureaux added bug Something isn't working server This issue requires changes to the server labels Jan 26, 2022
@lmoureaux lmoureaux added this to the v3.0-beta.1 milestone Jan 26, 2022
@lmoureaux lmoureaux added invalid This doesn't seem right wontfix This will not be worked on labels Feb 12, 2022
@lmoureaux
Copy link
Contributor Author

We don't install such a shortcut, so can't reproduce without additional instructions -> closing.
@Corbeau-1 was it you who reported this on Discord? If you have more info I'll reopen

@Corbeau-1
Copy link
Contributor

I can confirm that I have a version of ....1112 that has this bug.

Before hitting enter:

image

After hitting enter:

image

@lmoureaux
Copy link
Contributor Author

This looks like the debugging build for #824.

How did you start the server?

@lmoureaux lmoureaux changed the title Server started form windows menu blocks on input Server started from windows menu blocks on input Feb 13, 2022
@Corbeau-1
Copy link
Contributor

Corbeau-1 commented Feb 13, 2022

I doubleclicked freeciv21-server.exe.

And yes, the screenshot is from the build from #824, but just before that I tried it on ...1112, exactly the same result.

@lmoureaux lmoureaux changed the title Server started from windows menu blocks on input Server started from Windows Explorer blocks on input Feb 13, 2022
@lmoureaux lmoureaux reopened this Feb 13, 2022
@lmoureaux
Copy link
Contributor Author

That's why it's better to file issues yourself, I got it wrong and couldn't reproduce 😉

@lmoureaux lmoureaux removed invalid This doesn't seem right wontfix This will not be worked on labels Feb 13, 2022
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Feb 13, 2022
On Windows, there is apparently no unified non-blocking API to wait for
input on stdin.  Thus, call the blocking API from a worker thread.

Tested the following use cases:

* Starting from the Windows console
* Starting from Windows Explorer (should be the same, but who knows)
* Starting from the client (I guess stdin is a named pipe in this case)
* Starting from the MSYS console (no idea what it uses, maybe a file)

The thread is only used on Windows, no reason for the extra overhead to
propagate to sane OSes.

Closes longturn#850.
@Corbeau-1
Copy link
Contributor

That's why it's better to file issues yourself, I got it wrong and couldn't reproduce 😉

Right, sorry :) I didn't file an issue because I didn't think it was important. But it's probably important for general functioning of the software. I'll keep it in mind for the next time.

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Mar 1, 2022
On Windows, there is apparently no unified non-blocking API to wait for
input on stdin.  Thus, call the blocking API from a worker thread.

Tested the following use cases:

* Starting from the Windows console
* Starting from Windows Explorer (should be the same, but who knows)
* Starting from the client (I guess stdin is a named pipe in this case)
* Starting from the MSYS console (no idea what it uses, maybe a file)

The thread is only used on Windows, no reason for the extra overhead to
propagate to sane OSes.

Closes longturn#850.
jwrober pushed a commit that referenced this issue Mar 2, 2022
On Windows, there is apparently no unified non-blocking API to wait for
input on stdin.  Thus, call the blocking API from a worker thread.

Tested the following use cases:

* Starting from the Windows console
* Starting from Windows Explorer (should be the same, but who knows)
* Starting from the client (I guess stdin is a named pipe in this case)
* Starting from the MSYS console (no idea what it uses, maybe a file)

The thread is only used on Windows, no reason for the extra overhead to
propagate to sane OSes.

Closes #850.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server This issue requires changes to the server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants