[SERVER-2414] no clean shutdown under cygwin bash shell on ctrl-C Created: 27/Jan/11 Updated: 15/Aug/12 Resolved: 03/Jun/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.7.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | Tad Marshall |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | Windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7; Cygwin bash shell |
||
| Issue Links: |
|
||||||||
| Operating System: | Windows | ||||||||
| Participants: | |||||||||
| Description |
|
I was running with --dur and did a ctrl-c and it shutdown, but didn't cleanup the lock file. When starting without --dur it complains about the lock, and when starting with --dur it started fine. After removing the lock file it says it can't run without --dur because of the dur files. win7x64 |
| Comments |
| Comment by Tad Marshall [ 03/Jun/12 ] |
|
Issue is being tracked in |
| Comment by Tad Marshall [ 03/Jun/12 ] |
|
This is the same issue we see with some configurations of Cygwin, where ctrl-C isn't delivered correctly. |
| Comment by Tad Marshall [ 03/Dec/11 ] |
|
I reopened this because of |
| Comment by Tad Marshall [ 28/Nov/11 ] |
|
The problem is that our ctrl-C handler is written to run inside of a Windows console, and Cygwin doesn't provide one. We could write our own code to try to detect when we are running under Cygwin and allocate our own console, or we could write Cygwin-based code to accept Cygwin Unix-like signals, but none of this brings any actual benefit to users since they could just run us as a service and not rely on ctrl-C, or issue shutdownServer() from a client, or run us in a normal Windows command window. I'm calling it "Won't fix", it is not worth writing new code to deal with this. |
| Comment by Daniel Betz [ 25/Nov/11 ] |
|
The same issue appears with MongoDB 2.0.1 under msys bash. |
| Comment by Scott Hernandez (Inactive) [ 27/Jan/11 ] |
|
I did some more tests and there is indeed a difference in the behavior with 1.7.4/5. It is not some cygwin change... //ctlr-c killed, and resulted in clean shutdown, but no shutdown output $ ./mongod
Thu Jan 27 10:29:02 db version v1.7.4, pdfile version 4.5 //"shutdown" command issued from client skot@tip ~/temp/mongodb-win32-x86_64-1.7.4/bin
Thu Jan 27 10:29:23 db version v1.7.4, pdfile version 4.5 //Now, with 1.7.5 things have changed (same order: ctrl-c, shutdown command): skot@tip ~/temp/mongodb-win32-x86_64-1.7.5/bin
Thu Jan 27 12:32:23 [initandlisten] db version v1.7.5, pdfile version 4.5 skot@tip ~/temp/mongodb-win32-x86_64-1.7.5/bin
Thu Jan 27 12:32:28 [initandlisten] db version v1.7.5, pdfile version 4.5 skot@tip ~/temp/mongodb-win32-x86_64-1.7.5/bin skot@tip ~/temp/mongodb-win32-x86_64-1.7.5/bin
Thu Jan 27 12:33:00 [initandlisten] db version v1.7.5, pdfile version 4.5 |
| Comment by Scott Hernandez (Inactive) [ 27/Jan/11 ] |
|
This seems to be a problem with my current (or maybe new, in that it changed) cygwin env. It is not working for 1.7.4 anymore either. I don't think this is a new issue with 1.7.5, but I will continue to debug on my end. |
| Comment by Scott Hernandez (Inactive) [ 27/Jan/11 ] |
|
Only happens when started in bash/cygwin. Under cygwin: Wed Jan 26 16:59:27 [conn445] dropDatabase morphia_test for morphia_test.E skot@tip ~/temp/mongodb-win32-x86_64-1.7.5/bin here is output from cmd.exe console: C:\temp\mongodb-win32-x86_64-1.7.5\bin> |
| Comment by Eliot Horowitz (Inactive) [ 27/Jan/11 ] |
|
Can you send the console output? |
| Comment by Scott Hernandez (Inactive) [ 27/Jan/11 ] |
|
Upon further investigation this seems to be an unclean shutdown. ctrl-c no longer seems to work; It worked on 1.7.4 |
| Comment by Scott Hernandez (Inactive) [ 27/Jan/11 ] |
|
This seems to be unrelated to --dur. ctrl-c seems to leave the lock file no matter what. |