-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3: Implement status socket support for v3 #18
Comments
Issue Status: 1. Open 2. Started 3. Submitted 4. Done This issue now has a funding of 1500.0 DAI (1500.0 USD @ $1.0/DAI) attached to it.
|
Issue Status: 1. Open 2. Started 3. Submitted 4. Done Work has been started. These users each claimed they can complete the work by 1 month from now. 1) vporton has been approved to start work. I know Django very well. I also know Unix sockets. Please allow me to implement it. Learn more on the Gitcoin Issue Details page. |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done Work for 1500.0 DAI (1500.0 USD @ $1.0/DAI) has been submitted by: @ceresstation please take a look at the submitted work:
|
Hello there, thanks for your work! A few things to complete this task:
|
I don't quite understand about the heartbeat: In the v2 (whose logic I copied to v3) the socket is usually closed by Or do you want the socket logic in v3 be wastly different than in v2, not closing the socket after request? It was not specified so in the original issue. With the current (copied from v2) logic, the socket already can be used "as a ping" without heartbeat, simply by opening and closing it say every second. It is even easier to use than a special heartbeat. So is heartbeat necessary? Even if heartbeat is not necessary, which information should I add to the socket output? Number of descriptor publishes/fetches, number of consensus fetches, these things? |
FYI there's a PR for a simple dashboard that consumes the status socket: https://github.com/DonnchaC/onionbalance/pull/54/files |
tor uses |
You are right, thats indeed easier to use than a special heartbeat so no need to do that. While this has been requested in the past ,after discussing this with other OB devs, I decided that there is absolutely no use for that. Sorry for the confusion and thanks for pointing this out.
Sorry for not specifying this on the original post. Information has been garbled when we transitioned repositories from OBv2 to OBv3. To recap here is what we need for this ticket:
Bonus points if you write a small plugin for netdata that consumes the output of the socket. This has been asked before by onionbalance operators. I'm not adding it as a requirement but it would be great if it was done. Thanks a lot for the help and happy hacking! |
It is |
From DonnchaC/onionbalance#60: "the time of the last attempt to assemble a new master descriptor, and status thereof". What does the word "assemble" mean? Which function "assembles"? |
Clearly not possible: Unittesting this code would require its complete rewrite with dependency injection (because existing code uses the server state not something that could be put into a unit test as an object). That would introduce rather than solve bugs, what is directly contrary to the purpose of unittesting. Clearly, big work not worth to be done. |
Let's not change the v2 behavior, but yes we can rename the default v3 filename. Perhaps something like
That would be
I think unittests are essential here. In particular, I'd like unittests that check how we go from onionbalance config file to status socket filepath, and unittests that check the status socket output given various states of onionbalance (in terms of services, instances, descriptors, intro points). I'm not sure what you mean by "dependency injection" but it should be possible to write clean unittests for this feature by using mocking (e.g. see Thanks a lot for the great work :) |
Is "master descriptor" the same as "first descriptor"? Or are both attempts to publish first descriptor and attempts to publish second descriptor attempts to assemble a new master descriptor? |
The concept of 'master descriptor' does not exist in v3. Both 'first' and 'second' are master descriptors. So we need publish timestamps for both of them. |
Should this time be updated every time |
It should only be updated when we actually publish a descriptor. So yeah def only after |
What is "status thereof"? What to show yet? |
Status is whether the upload succeded or failed. In theory we can get the status using the events from |
Do you really want to unittest this single Python line? status_socket_location = my_onionbalance.config_data.get('status-socket-location',
params.STATUS_SOCKET_LOCATION) |
Hello. I was thinking that a unittest here would start with Hope that makes sense. |
All done! Well, except "write a small plugin for netdata that consumes the output of the socket". How much will I receive in addition if I do this additional task? |
Looking pretty good @vporton ! Pointed out a bunch of stuff and we should be close to done. About how much more you will receive if you do the netdata thing, I don't really control the financial here, so I don't think I can expand the bounty... :/ |
OK this looks and tests good. A final round of revisions and this should be good to go. |
Merged! Thanks! |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done The funding of 1500.0 DAI (1500.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @vporton.
|
There is currently no status socket support for v3. We need to implement this since people seem to use it. Patches welcome.
The text was updated successfully, but these errors were encountered: