Opened 9 years ago

Closed 9 years ago

#292 closed enhancement (complete)

Asynchronous support for python config ccsession library

Reported by: fujiwara Owned by: fujiwara
Priority: low Milestone:
Component: configuration Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Python config library (lib/python/isc/config/ccsession.py)'s check_command method blocks and receives data from session.
But a session can be shared with config and another group data.

I propose two enhancements.
One is non_blocking option for check_command() method.
The other is new check_command_without_recvmsg() method.
I made a patch at experiments/fujiwara-stats branch revision 2218.

The latter enables that we can share a session with config and another data, and if the received message is for config module, then call check_command_without_recvmsg() with received message.

Subtickets

Change History (4)

comment:1 Changed 9 years ago by jelte

  • Owner changed from jelte to fujiwara
  • Status changed from new to assigned

r2218 looks fine to me, apart from that there is no docstring for the new function

"""Parse the given message to see if there is a command or a configuration update. Calls the corresponding handler functions if present. Responds on the channel if the handler returns a message."""

and perhaps the first function should have a comment that it calls this one if it reads a message from the channel

I'm wondering though, should we make the new function return something so that the caller knows whether it did something (for instance, if the message did indeed have a command or config update, and it is handled, return true, or false otherwise)?

BTW, slightly offtopic, but the experiments/fujiwara-stats branch does not compile for me, it looks like it's missing a Makefile in src/bin/stats/ (I'm guessing it's there on your system but not added to svn)

do you want to merge this separately from the rest of the branch?

comment:2 Changed 9 years ago by fujiwara

Sorry, I missed this article.
I'm preparing trac292 branch and fixed comments.
It does not contain src/bin/stats/ because they are updated by kambe.

Do we need test change ?

comment:3 Changed 9 years ago by jelte

  • Status changed from assigned to reviewing

I've added and modified one tests, where some code (that you didn't touch, but which was in the newly created function) was not covered, see r3256. It also showed a potential bug which i fixed :)

So apart from the split into check_command_without_recvmsg there are no changes? (i.e. this is not directly used yet?)

The split up itself looks ok. As long as we will actually use it somewhere :)

comment:4 Changed 9 years ago by fujiwara

  • Resolution set to complete
  • Status changed from reviewing to closed

merged. closing.

Note: See TracTickets for help on using tickets.