Closed Bug 996870 Opened 11 years ago Closed 2 years ago

The __heartbeat__ check should verify that the db is healthy

Categories

(Cloud Services Graveyard :: Server: Token, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rfkelly, Unassigned, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [qa+])

Currently it just returns "OK" without checking anything. This used to be the standard behaviour, but in the new world we expect this to check health of dependant services such as the db. We should update it to do such checking.
+1
Whiteboard: [qa+]
Priority: -- → P1
Assignee: nobody → rfkelly
QA Contact: jbonacci
No longer blocks: 956217
Mentor: rfkelly
Whiteboard: [qa+] → [qa+][good first bug]
Assignee: rfkelly → nobody
Hello Ryan, I am very new to the Mozilla community and just got my development environment set up using this page https://developer.mozilla.org/en-US/docs/Simple_Firefox_build and would like to start with a good first bug that is also mentored, if available I was wondering what the first steps for me would be?
Hi Tanner, sorry for the delay in getting back to you here. I'm happy to help with mentoring this bug if you're still interested. Note though that it's a bug in server-side python code [1], not in the Firefox client codebase, so you'll need a different dev setup to the one you linked above. If you want to try getting setup, you can: * Make sure you've got git and python installed on your machine * Clone this git repository: https://github.com/mozilla-services/tokenserver * cd ./tokenserver ; make build ; make test Let me know how it goes and if you're still interested in taking this one on, or would prefer a Firefox client bug.
Flags: needinfo?(tparker12)
OK, so some pointers to get up and running with this: * The default definition for the __heartbeat__ route is in a utility library at [1]. You'll probably want to copy the definition out of there and into ./tokenserver/views.py so that you can expand it into a custom version. * To check if the db is healthy, the new view can get the backend implementation object like in [2], and just call its get_user() method with dummy arguments. If that succeeds, the backend db is OK; if it throws an exception then there's probably something wrong with the DB, and __heartbeat__ should return a 503. * You'll also need to add an API test in ./tokenserver/tests/test_service.py to assert that the URL is behaving correctly. [1] https://github.com/mozilla-services/mozservices/blob/master/mozsvc/views.py [2] https://github.com/mozilla-services/tokenserver/blob/master/tokenserver/views.py#L188
Flags: needinfo?(tparker12)
Hello Ryan, I'm just starting out contributing to open source for a class and I'm willing to tackle this bug, I'm trying to learn more about the Mozilla code base. already, have both git bash and python running on my machine.Is there a possibility that you can mentor me on what do?
Hi bidahor13, I believe Tanner is already actively working on this bug as requested in Comment 2, so I've updated the bug status to reflect that.
Assignee: nobody → tparker12
Priority: P1 → --
Resetting status of this bug, but it's still something we should get around to fixing up.
Assignee: tparker12 → nobody
QA Contact: jbonacci
Can I take this issue? I have good understanding of cloud IaaS. Need guidance where to start for this bug. Thanks !
Hi Mayur, thanks for reaching out, you're welcome to dive in and have a go at this bug. How familiar are you with writing python for server software? I suggest starting by checking out the tokenserver repo here: https://github.com/mozilla-services/tokenserver And ensuring you can get it building and passing tests locally. After that, take a look at my Comment 4 and let me know what follow-up questions have you, if any.
Assignee: nobody → nobody

Hi,

Is anybody looking at this bug? If not, can I pick it up? I would like to start my open source contribution with this bug. Please let me know what extra steps I need to follow besides the mentioned above.

Thank you,
Ishan

Keywords: good-first-bug
Whiteboard: [qa+][good first bug] → [qa+]

As of 2022 we've switched tokenserver to the new Rust version and its heartbeat checks the database, closing.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.