Closed Bug 865758 Opened 11 years ago Closed 11 years ago

Improve error handling of Mongodb error cases

Categories

(Webmaker Graveyard :: Login, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sedge, Assigned: sedge)

References

Details

(Whiteboard: u=dev c=login p=1 s=2013w18)

Attachments

(1 file, 1 obsolete file)

At the moment, the server continues to run in the case of a Mongodb connection error.  Instead, it should kill the process and complain loudly.
I think for something important this feels a bit to simple for what we're looking for.

This will only alert in the console that things have broken yeah?
Comment on attachment 743098 [details] [review]
Pull request for this patch

I did the review wrong - but comment above: ^^
Attachment #743098 - Flags: review?(ross) → review-
Right now it's just a console message.  This patch would cause the server to exit in the case that a mongo database can't be found.  This would only happen if it can't find a database immediately after the server starts, so I think it's a good fix.
Have a look with the makeAPI folk to see what they're doing to handle things.

If they're cool with is so am I
Attachment #743098 - Flags: review- → review?(chris)
Whiteboard: u=dev c=login p=1 s=2013w17 → u=dev c=login p=1 s=2013w18
This is actually up to JP. He's doing some testing with autoscale groups to see what the time in and out is like. If he doesn't want the process to exit, we should write a little library that handles a /healthcheck endpoint and the various dependent connections a process needs.
https://github.com/mozilla/login.webmaker.org/pull/30
Attachment #743098 - Attachment is obsolete: true
Attachment #743098 - Flags: review?(chris)
Attachment #743259 - Flags: review?(ross)
Attachment #743259 - Flags: review?(david.humphrey)
Comment on attachment 743259 [details] [review]
Pull request for this patch

A couple of nits regarding coding style - but the logic behind things looks good.

r+ assuming the nits and code style is cleaned up
Attachment #743259 - Flags: review?(ross) → review+
Comment on attachment 743259 [details] [review]
Pull request for this patch

Further work to be done..
Attachment #743259 - Flags: review?(david.humphrey)
Attachment #743259 - Flags: review+
Comment on attachment 743259 [details] [review]
Pull request for this patch

The changes are now stable.
Attachment #743259 - Flags: review?(ross)
Attachment #743259 - Flags: review?(david.humphrey)
Comment on attachment 743259 [details] [review]
Pull request for this patch

A few comments in the pull request.  One big issue is that I think you want to change all the `400` result codes to `404` for the case where a user ID isn't found.  A `400` means "bad syntax" where `404` means "resource not found."
Attachment #743259 - Flags: review?(david.humphrey) → review-
Comment on attachment 743259 [details] [review]
Pull request for this patch

Changed the 400 error codes
Attachment #743259 - Flags: review- → review?(david.humphrey)
Comment on attachment 743259 [details] [review]
Pull request for this patch

14:02 < humph> Let's change the error message
14:02 < sedge> okay
14:02 < humph> not that it failed
14:02 < humph> but that there was no connection
14:03 < sedge> "No connection found"
14:03 < sedge> ok
14:03 < daleee> mjschranz: thank you, did not know about fillmurray
14:03 < humph> and this is probably OK
14:03 < sedge> for now anyway?
14:03 < humph> file a new bug on integrating with the /healthcheck endpoint
14:03 < sedge> okay
14:03 < sedge> on it

r+ with those things done.
Attachment #743259 - Flags: review?(david.humphrey) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment on attachment 743259 [details] [review]
Pull request for this patch

Can we close the review on this ticket?
Attachment #743259 - Flags: review?(rossbruniges)
Attachment mime type: text/plain text/plain → text/x-github-pull-request text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: