[Reconnoiter-devel] [reconnoiter commit] Reconnoiter branch, master, updated. 0925738c7f2feb200faf8af7721055416b357f44

git at labs.omniti.com git at labs.omniti.com
Thu Nov 17 17:55:56 EST 2011


Pushed by: jesus
The branch, master has been updated
       via  0925738c7f2feb200faf8af7721055416b357f44 (commit)
       via  bff7408283cab40cb7ba5f8c76538eaabc4f969f (commit)
       via  501e231d70284a477bc5679249d40b68f9167fc0 (commit)
       via  33b7efe6ca32e4a2a683db89cf86828a9b1ab096 (commit)
      from  f760d4895a5e1b4ab500749f7274fc84c215cfa7 (commit)

Summary of changes:
 src/eventer/eventer_epoll_impl.c |   10 +++++-----
 src/modules/check_test.c         |    3 ++-
 src/modules/lua.c                |    6 +++---
 src/modules/lua_noit.c           |    1 +
 4 files changed, 11 insertions(+), 9 deletions(-)

Log:
commit 0925738c7f2feb200faf8af7721055416b357f44
Merge: f760d48 bff7408
Author: Theo Schlossnagle <jesus at omniti.com>
Date:   Thu Nov 17 17:55:22 2011 -0500

    Merge branch 'evmisuse'


commit bff7408283cab40cb7ba5f8c76538eaabc4f969f
Merge: a23f396 501e231
Author: Theo Schlossnagle <jesus at omniti.com>
Date:   Fri Nov 11 13:53:32 2011 -0500

    Merge branch 'fix_eventer_usage_under_epoll' of http://github.com/ddispaltro/reconnoiter into evmisuse


commit 501e231d70284a477bc5679249d40b68f9167fc0
Author: Dan Di Spaltro <dan at cloudkick.com>
Date:   Tue Nov 8 16:17:23 2011 -0800

    Remove and then re-add, should this just be an update?

diff --git a/src/modules/lua_noit.c b/src/modules/lua_noit.c
index 6435102..2a016b6 100644
--- a/src/modules/lua_noit.c
+++ b/src/modules/lua_noit.c
@@ -714,6 +714,7 @@ noit_lua_socket_read(lua_State *L) {
     return args;
   }
 
+  eventer_remove_fd(e->fd);
   e->callback = noit_lua_socket_read_complete;
   e->mask = mask | EVENTER_EXCEPTION;
   eventer_add(e);

commit 33b7efe6ca32e4a2a683db89cf86828a9b1ab096
Author: Dan Di Spaltro <dan at cloudkick.com>
Date:   Mon Nov 7 20:38:47 2011 -0800

    Assert when result is not 0
    Fix usage where we re-add an already added event.
    Fix usage where we remove after closing, change the order in that case

diff --git a/src/eventer/eventer_epoll_impl.c b/src/eventer/eventer_epoll_impl.c
index b9cfba5..9fdc954 100644
--- a/src/eventer/eventer_epoll_impl.c
+++ b/src/eventer/eventer_epoll_impl.c
@@ -113,7 +113,7 @@ static void eventer_epoll_impl_add(eventer_t e) {
   lockstate = acquire_master_fd(e->fd);
   master_fds[e->fd].e = e;
 
-  epoll_ctl(epoll_fd, EPOLL_CTL_ADD, e->fd, &_ev);
+  assert(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, e->fd, &_ev) == 0);
 
   release_master_fd(e->fd, lockstate);
 }
@@ -131,7 +131,7 @@ static eventer_t eventer_epoll_impl_remove(eventer_t e) {
     if(e == master_fds[e->fd].e) {
       removed = e;
       master_fds[e->fd].e = NULL;
-      epoll_ctl(epoll_fd, EPOLL_CTL_DEL, e->fd, &_ev);
+      assert(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, e->fd, &_ev) == 0);
     }
     release_master_fd(e->fd, lockstate);
   }
@@ -159,7 +159,7 @@ static void eventer_epoll_impl_update(eventer_t e, int mask) {
     if(e->mask & EVENTER_READ) _ev.events |= (EPOLLIN|EPOLLPRI);
     if(e->mask & EVENTER_WRITE) _ev.events |= (EPOLLOUT);
     if(e->mask & EVENTER_EXCEPTION) _ev.events |= (EPOLLERR|EPOLLHUP);
-    epoll_ctl(epoll_fd, EPOLL_CTL_MOD, e->fd, &_ev);
+    assert(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, e->fd, &_ev) == 0);
   }
 }
 static eventer_t eventer_epoll_impl_remove_fd(int fd) {
@@ -172,7 +172,7 @@ static eventer_t eventer_epoll_impl_remove_fd(int fd) {
     lockstate = acquire_master_fd(fd);
     eiq = master_fds[fd].e;
     master_fds[fd].e = NULL;
-    epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &_ev);
+    assert(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &_ev) == 0);
     release_master_fd(fd, lockstate);
   }
   return eiq;
@@ -207,7 +207,7 @@ static void eventer_epoll_impl_trigger(eventer_t e, int mask) {
     if(newmask & EVENTER_READ) _ev.events |= (EPOLLIN|EPOLLPRI);
     if(newmask & EVENTER_WRITE) _ev.events |= (EPOLLOUT);
     if(newmask & EVENTER_EXCEPTION) _ev.events |= (EPOLLERR|EPOLLHUP);
-    epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &_ev);
+    assert(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &_ev) == 0);
     /* Set our mask */
     e->mask = newmask;
   }
diff --git a/src/modules/check_test.c b/src/modules/check_test.c
index 6d60094..131a13c 100644
--- a/src/modules/check_test.c
+++ b/src/modules/check_test.c
@@ -190,7 +190,8 @@ rest_test_check_result(struct check_test_closure *cl) {
     noit_http_response_end(ctx);
   
     if(conne) {
-      eventer_add(conne);
+      // The event already exists, why re-add it?  Did we want to update it?
+      //eventer_add(conne);
       eventer_trigger(conne, EVENTER_READ | EVENTER_WRITE);
     }
   }
diff --git a/src/modules/lua.c b/src/modules/lua.c
index f0e118f..e43e5e6 100644
--- a/src/modules/lua.c
+++ b/src/modules/lua.c
@@ -101,13 +101,13 @@ noit_event_dispose(void *ev) {
   eventer_t *value = ev;
   eventer_t removed, e = *value;
   noitL(nldeb, "lua check cleanup: dropping (%p)->fd (%d)\n", e, e->fd);
+  removed = eventer_remove(e);
+  noitL(nldeb, "    remove from eventer system %s\n",
+        removed ? "succeeded" : "failed");
   if(e->mask & (EVENTER_READ|EVENTER_WRITE|EVENTER_EXCEPTION)) {
     noitL(nldeb, "    closing down fd %d\n", e->fd);
     e->opset->close(e->fd, &mask, e);
   }
-  removed = eventer_remove(e);
-  noitL(nldeb, "    remove from eventer system %s\n",
-        removed ? "succeeded" : "failed");
   if(e->closure) {
     struct nl_generic_cl *cl;
     cl = e->closure;




hooks/post-receive
-- 
Reconnoiter


More information about the Reconnoiter-devel mailing list