-
Notifications
You must be signed in to change notification settings - Fork 316
Run server with child process. #167
Run server with child process. #167
Conversation
…process to read data from input
You can test following case. Case 1. Test connected server-side socket which is passed to a child process. You can do this by running server with '-p' option. ('./server 1337 -p') Case 2. Test connected server-side socket which is used in server process. Case 3. Test socket in which variable length data go through. You can do this by running server with '-l' option. ('./server 1337 -l 256') To create test programs. gcc -o server server.c -lws2_32 gcc -o client client.c -lws2_32 gcc -o clt_writer clt_writer.c To test case 1. ./server 1337 -p & ./client 127.0.0.1 1337 To test case 2. ./server 1337 & ./client 127.0.0.1 1337 To test case 3. ./server 1337 -l 500 & ./client 127.0.0.1 1337 To test case 1 and 3. ./server 1337 -p -l 256 & ./client 127.0.0.1 1337 To test case 2 and 3. ./server 1337 -l 256 & ./client 127.0.0.1 1337
MSysGit - the development behind Git for Windows » git #195 SUCCESS |
@toshiyuki-ogawa the error message you receive is not the same as with git-daemon, correct? Maybe it would be better if I was able to reproduce the original problem with |
I wouldn't think error message is not same unfortunately.
The above message was produced from reading the socket which is connected to server child process stdout. |
Bummer. Do you think you could come up with a patch to, say, Please understand that my reluctance stems from the huge diff at https://github.com/msysgit/git/pull/70/files just to fix something that intuitively should add a |
It is difficult to answer your question. I can't say whether yes or no. I would like to focus on this test(client and server), |
@toshiyuki-ogawa TBH I am unsure how to proceed. My idea to have a minimal example did not work out: we do not have a robust way to reproduce the problem you tried to fix in #70. I hope to find some time this weekend to play more with it, but feel free to go whichever direction you feel makes most sense. |
I don't think so. Your minimal example reproduced the problem in #70. The message was different from git client, but it was same problem that the client did not completely read data which server send.
figure 2. Error message case
I think the remarkable points are 2 and 3 in above figure 2. If the clt_writer stdout has socket attribute, client may read data with out error message. |
Thanks for the detailed explanation! I'll give it a try but for now I am starting to be optimistic again that the issue might be fixed simply by refusing to exit() from the server as long as there is even one running child... |
I think that it would be fine to make git by refusing to exit. I want git version to run in any communication environment. I would concern myself about bellow two topics.
Actually, In my pull-request #70, All processes which run from git-daemon need to be modified to check whether stdout and stdin are treated as socket. I checked the issue #101 recently, and I studied about the issue. I am doubting the problem of socket attributes inheritance too. I added some lines to debug in some codes, and found a line which never come back. The line is only writing to some data to file descriptor. Here is the line which never come back. Here is calling sequence
I would like to study and fix the problem, but I am afraid of unacceptable pull-request for complex code. |
Since Git for Windows 1.x was retired, I am closing this ticket. However, it will be very valuable when I come around to attacking git-for-windows#304. |
You can run server with child process.
You can specify some server options.
Here is options
1 -l [number] you can specify [number] how many lines to send message for client
2 -p You can send server message in child process which is spawned in server
I got bellow error in my environment, if I run server to write data in child process file descriptor.
Here is instructions and out put
./server 1234 -l 256 -p & ./client 127.0.0.1 1234
Here is output
0 I got the connection
1 I got the connection
2 I got the connection
3 I got the connection
4 I goError reading from socket:Function not implemented
@dscho Would you mean that I work for above extension, not yourself? If you didn't, I will cancel this pull request.