Skip to content
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

ASYNC_CHANGE_FD status + db engine async state parameter + db_virtual async #715

Merged
merged 3 commits into from Feb 19, 2016

Conversation

ionutrazvanionita
Copy link
Contributor

This pull requests adds the following:

  • added a new status - ASYNC_CHANGE_FD which allows changing the file descriptor in the reactor if something goes wrong in the resume function, such that you can do failover
  • added a state parameter for database async query - database engines can now use a parameter to hold state between the async call (async_raw_query) and the async resume (async_raw_resume)
  • adapted sipcapture and avpops to the new functionalities
  • db_virtual can now use the async raw query functionality; since mysql is the only engine that supports this, it will be the only one supported

@bogdan-iancu
Copy link
Member

@liviuchircu , please review this patch

@@ -36,7 +36,8 @@
* NOTE: all values in this enum must be negative
*/
enum async_ret_code {
ASYNC_NO_IO = -5,
ASYNC_NO_IO = -6,
ASYNC_CHANGE_FD,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest moving ASYNC_CHANGE_FD two spots below, since it's still an async operation (but on a new DB backend/host), along with ASYNC_CONTINUE.

ionutrazvanionita added 3 commits February 18, 2016 11:55
Allows changing the file descriptor in the resume function. Such
functionality is useful for failover purposes, like having
multiple destinations, you find that one is not working only in
the resume function and you want to try another one. Now you
can change the file descriptor, remove the old one and add the
new descriptor and then wait for it to be triggered.
Databases can now keep their state between the async call and the
resume parameter using a newly added (void*) parameter. It is the
job of the upper layer(the module calling the async function) to
store this database state inside the (void*) parameter they are using
to hold their state (see avpops and sipcapture async handling).

Also this patch handles the new ASYNC_CHANGE_FD state in avpops
and sipcapture.
liviuchircu added a commit that referenced this pull request Feb 19, 2016
ASYNC_CHANGE_FD status + db engine async state parameter + db_virtual async
@liviuchircu liviuchircu merged commit 9cf7bec into OpenSIPS:master Feb 19, 2016
@ionutrazvanionita ionutrazvanionita deleted the db_virtual_async branch April 22, 2016 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants