Skip to content

Async seems to fail randomly... #3

Closed

Description

@TooTallNate

I'm attempting to write an HTTP serving layer using this lib. Great stuff so far, but I've come across some of the callbacks not getting their return objects filled out properly (everything being set to 0 or null). This test case demonstrates:

var gitteh = require('gitteh');

var repo = gitteh.openRepository('./.git');
var i = 100;
var good = 0;
var bad = 0;
while (i--) {
  repo.getCommit("271015640405704dc7f7a2a5ad5510602174d7cf", function(err, commit) {
    if (err) throw err;
    if (commit.message === null) {
      bad++;
    } else {
      good++;
    }
  });
}

process.on('exit', function() {
  console.error("Good:", good);
  console.error("Bad:", bad);
});

Hopefully you can get a chance to fix it soon, because otherwise my HTTP layer is working! Thanks in advance!

Activity

  1. samcday commented on Mar 29, 2011

    @samcday
    Contributor

    Heya!

    This seems to be a weird concurrency issue when constructing git objects asynchronously. Oddly enough now that you've mentioned this, I tried to reproduce and couldn't do so at all on either my dev box in the office or at home. However trying the same test on a server I have access to I'm getting this issue when I run the tests for example.

    I'll look into this shortly and see what's up.

  2. samcday commented on Mar 29, 2011

    @samcday
    Contributor

    ... The fix is up, and it was embarassingly simple, just wasn't initializing some struct data properly. As far as I can see, this issue is fixed now - can you confirm and close this issue if master is working for you now.

  3. TooTallNate commented on Mar 29, 2011

    @TooTallNate
    Author

    Yes, seems to be working for me now. Thanks for the quick reply and fix! You rock!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions