Opened 8 years ago

Closed 7 years ago

#1764 closed task (duplicate)

make SyncUDPServer even more simpler (and probably faster)

Reported by: jinmei Owned by:
Priority: high Milestone:
Component: b10-auth Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket: auth performance
Estimated Difficulty: 6 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

From a quick look, the SyncUDPServer class can be more cleaned up,
some of which I suspect contributes to non negligible performance
improvement.

First off, about the concept: when I first named "sync", I meant the
"lookup callback" complete everything, and other asynchronous
considerations (such as getting CC messages) should be done elsewhere.
Therefore,

  • It shouldn't take "checkin_callback" parameter (at least auth should pass NULL)
  • It shouldn't take "answer_callback" parameter (again, at least auth should pass NULL)
  • it doesn't need "answer_" member variable ("query_" should contain a response to be sent back on return of "lookup_callback_")
  • "stopped" doesn't have to be checked within handleRead().

In addition, 'socket' doesn't have to be constructed every time: it
can be initialized on consturction with socket_ and should be reusable
throughout the class object's lifetime. There can be several similar
points that can be cleaned up this way.

Subtickets

Change History (6)

comment:1 follow-up: Changed 8 years ago by vorner

While I agree with these simplifications, I'd like to say that the check_in callback is not used at all and the answer_callback could be removed from the resolver as well, so we could remove these hooks from interface completely. That would be generally cleaner.

I needed to add one stopped check because the tests were failing without it. Maybe it is OK for the class to behave differently there, but I like it having the same interface.

comment:2 in reply to: ↑ 1 Changed 8 years ago by jinmei

Replying to vorner:

While I agree with these simplifications, I'd like to say that the check_in callback is not used at all and the answer_callback could be removed from the resolver as well, so we could remove these hooks from interface completely. That would be generally cleaner.

Yes, I noticed at least some of the callbacks shouldn't be needed for
the resolver. If the overall cleanup isn't a big task I'm okay with
cleaning up everything we can within this ticket.

comment:3 Changed 8 years ago by jelte

  • Estimated Difficulty changed from 0 to 6

comment:4 Changed 7 years ago by jinmei

  • Milestone set to Next-Sprint-Proposed

comment:5 Changed 7 years ago by jinmei

#2903 included this task. Closing.

comment:6 Changed 7 years ago by jinmei

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.