Changeset 2bdd297562b53dbee111cfefd2101bb9eb99d036

Show
Ignore:
Timestamp:
06/24/08 17:25:13 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1214328313 +0000
git-parent:

[42acb3f97cfb6da615fe7d1186a1e052eeec72fd]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1214328313 +0000
Message:

fixes #35

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_jlog_listener.c

    r1f7257a r2bdd297  
    1414#include <unistd.h> 
    1515#include <sys/ioctl.h> 
     16#define MAX_ROWS_AT_ONCE 1000 
     17#define DEFAULT_SECONDS_BETWEEN_BATCHES 5 
    1618 
    1719void 
     
    8991  while(1) { 
    9092    jlog_id client_chkpt; 
     93    int sleeptime = DEFAULT_SECONDS_BETWEEN_BATCHES; 
    9194    jlog_get_checkpoint(jcl->jlog, ac->remote_cn, &jcl->chkpt); 
    9295    jcl->count = jlog_ctx_read_interval(jcl->jlog, &jcl->start, &jcl->finish); 
     96    if(jcl->count > MAX_ROWS_AT_ONCE) { 
     97      /* Artificially set down the range to make the batches a bit easier 
     98       * to handle on the stratcond/postgres end. 
     99       * However, we must have more data, so drop the sleeptime to 0 
     100       */ 
     101      jcl->count = MAX_ROWS_AT_ONCE; 
     102      jcl->finish.marker = jcl->start.marker + jcl->count; 
     103      sleeptime = 0; 
     104    } 
    93105    if(jcl->count > 0) { 
    94106      if(noit_jlog_push(e, jcl)) { 
     
    119131      jlog_ctx_read_checkpoint(jcl->jlog, &jcl->chkpt); 
    120132    } 
    121     sleep(5); 
     133    if(sleeptime) sleep(sleeptime); 
    122134  } 
    123135 
  • src/stratcon_datastore.c

    rcdec30d r2bdd297  
    162162                  raddr, sizeof(raddr)); 
    163163        break; 
     164      default: 
     165        noitL(noit_error, "remote address of family %d\n", r->sa_family); 
    164166    } 
    165167