Bug 824405 - Mongodb server reports it's started to systemd but it's not accepting connections
Mongodb server reports it's started to systemd but it's not accepting connect...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mongodb (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Marek Skalický
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 824362
  Show dependency treegraph
 
Reported: 2012-05-23 08:11 EDT by Lukas Zapletal
Modified: 2015-01-12 11:17 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-12 11:17:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukas Zapletal 2012-05-23 08:11:43 EDT
Description of problem:

When you start mongodb and immediately try to connect to the database, it will sometimes fail because server is not ready. Currently mongodb uses "fork" systemd type.


Version-Release number of selected component (if applicable):
mongodb-2.0.2-8.fc16.x86_64


Steps to Reproduce:
1. service mongod stop
2. service mongod start && mongo
3.
  
Actual results:
# service mongod start && mongo
Redirecting to /bin/systemctl  start mongod.service
MongoDB shell version: 2.0.2
connecting to: test
Wed May 23 14:10:49 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84
exception: connect failed


Expected results:
Connected

Additional info:
It breaks our Katello installer, we need to implement a "sleep" workaround until this is fixed: https://bugzilla.redhat.com/show_bug.cgi?id=824362
Comment 1 Michal Schmidt 2012-05-23 08:26:13 EDT
I see that mongodb already uses a pipe to communicate the readiness of the child process to the parent after writing its PID file. So far so good. However, it sets up its listening sockets later than this.
A common meaning of readiness is that the daemon is accepting connections.
Comment 2 Lukas Zapletal 2012-05-28 03:18:35 EDT
Hey, I just found the timeout is caused by mongo data files preallocation during its very first start. This is nasty behaviour, I'd like to see a script or sysvinit command that would allow external preallocation. Something like:

service mongod init

or

mongod-init

with this content:

dd if=/dev/zero of=/var/lib/mongodb/journal/prealloc.0 bs=1M count=1K
dd if=/dev/zero of=/var/lib/mongodb/journal/prealloc.1 bs=1M count=1K
dd if=/dev/zero of=/var/lib/mongodb/journal/prealloc.2 bs=1M count=1K
Comment 3 Felix Schwarz 2012-11-22 12:49:32 EST
(In reply to comment #2)
> dd if=/dev/zero of=/var/lib/mongodb/journal/prealloc.0 bs=1M count=1K
> dd if=/dev/zero of=/var/lib/mongodb/journal/prealloc.1 bs=1M count=1K
> dd if=/dev/zero of=/var/lib/mongodb/journal/prealloc.2 bs=1M count=1K

That doesn't work with smallfiles=True, right?
Comment 4 Lukas Zapletal 2013-01-15 03:46:16 EST
I guess it would work - the file would be left unused then. But the init script could grep this option yeah...
Comment 5 Fedora End Of Life 2013-04-03 12:28:40 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 6 Fedora End Of Life 2015-01-09 12:09:42 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Marek Skalický 2015-01-12 11:17:06 EST
This is fixed in rawhide (also in F21). Closed...

Feel free to reopen.

Note You need to log in before you can comment on or make changes to this bug.