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)
Cloud Services Graveyard
Server: Token
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.
| Reporter | ||
Updated•11 years ago
|
Priority: -- → P1
Updated•11 years ago
|
Assignee: nobody → rfkelly
QA Contact: jbonacci
| Reporter | ||
Updated•11 years ago
|
Mentor: rfkelly
Whiteboard: [qa+] → [qa+][good first bug]
| Reporter | ||
Updated•10 years ago
|
Assignee: rfkelly → nobody
Comment 2•9 years ago
|
||
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?
| Reporter | ||
Comment 3•9 years ago
|
||
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)
| Reporter | ||
Comment 4•9 years ago
|
||
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?
| Reporter | ||
Comment 6•9 years ago
|
||
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
Updated•9 years ago
|
Priority: P1 → --
| Reporter | ||
Comment 7•7 years ago
|
||
Resetting status of this bug, but it's still something we should get around to fixing up.
Assignee: tparker12 → nobody
QA Contact: jbonacci
Comment 8•7 years ago
|
||
Can I take this issue?
I have good understanding of cloud IaaS.
Need guidance where to start for this bug.
Thanks !
| Reporter | ||
Comment 9•7 years ago
|
||
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.
Updated•6 years ago
|
Assignee: nobody → nobody
Comment 10•6 years ago
|
||
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
Updated•5 years ago
|
Keywords: good-first-bug
Whiteboard: [qa+][good first bug] → [qa+]
Comment 11•2 years ago
|
||
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
Updated•2 years ago
|
Product: Cloud Services → Cloud Services Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•