Code Monkey home page Code Monkey logo

haibu-carapace's People

Contributors

bmeck avatar coderarity avatar indexzero avatar jamesonjlee avatar julianduque avatar marak avatar mmalecki avatar nakosung avatar southern avatar stolsma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haibu-carapace's Issues

Guide for creating new Plugins?

I couldn't find a guide on how to create new plugins. Not all of the plugins are written the same way, what is the best way to get started?

[v0.6] `net` module wrapper fails to override `_doListen` correctly

That's because net.Server.prototype._doListen doesn't exist in v0.6. My guess is that we should override _listen2 instead, but I'm not familiar with net module internals.

This causes tests to fail:

♢ carapace/net/dolisten

  When using haibu-carapace
    ✓ it should fire the carapace::listening event
  When using haibu-carapace spawning the server-dolisten.js script the child carapace should exit
    ✗ with the correct exit code
      » expected 0,
    got  1 (==) // net-multiple-servers-test.js:61
    ✗ and 3x emit the *::carapace::port event with the correct port
      » expected 3,
    got  0 (==) // net-multiple-servers-test.js:66

(Fixture exits here).

Examples not working as expected

This is what is happening when I try and run the example:

$ node -v
v0.6.10
$ sudo node ./examples/jailer.js 
hello { [Error: EPERM, Operation not permitted] errno: 1, code: 'EPERM', syscall: 'setgid' }
undefined
server.js running on port 31337
$ curl http://localhost:31337
curl: (7) couldn't connect to host

What is it supposed to be doing? It would be helpful to include what you expect the examples to output in the README so I can compare my output to what the correct output.

`net` module wrapper doesn't override host argument?

I saw an issue where an application was explicitly listening to localhost, this was preventing it from being seen on the network.

Can we also add the ability to override the host argument passed to net.listen?

C++ modules that use C sockets don't work

zeromq and other addons that do not allow for communication over existing sockets do not work properly with the rebinding shim. The proper solution would be forcing carapaced packages to be recompiled with fake headers and providing a secondary rebinding shim in C++.

The recommended workaround is to avoid these modules and note to them this tight coupling in hopes they eventually patch their modules (or libraries that are used).

Race condition for same ports

Today I started 5 apps at the same time (all doing the same with the same code) with haibu, all trying to bind to port 8000. But I noticed strange things happening. Sometimes one or two apps had to be started twice by forever. I noticed it because of the logging msgs.

It all points to line 103 and further in net.js where, because of the process.nextTick, another 'process' (in my case another app) can bind first to the 'free' port. And the other app will fail with a EADDRINUSE error, which crashes the app...

Luckily I remembered that @bmeck also made a pull request for node (see nodejs/node-v0.x-archive#1412) and I noticed that that code is different then the current code for _doListen in net.js. Especially the code between the 2nd try..catch is different where in the pull code there is another check for EADDRINUSE which will trigger a new _doListen call...

Implementing the pull code solved the problem so maybe can someone implement the new code in net.js ??

Thanks!!

detecting ports the easy way

figured out a waaaay simpler method to discover the port an app has started on

lsof -a -p $PID -i TCP

COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node    19423 dominic    5u  IPv4 244275      0t0  TCP *:8000 (LISTEN)

no need for complicated monkey patching or IPC.

Problem installing

First of all: I like the progress made with Haibu!! Just came back from a 4 week holiday and was surprised to see the nice structural changes!! Keep on going!! :-)

But when installing all the needed packages for the new version of Haibu I had some problems getting haibu-carapace installed. Every time I did a npm install I got:

> [email protected] preinstall /home/sander/Development/haibu/node_modules/haibu-carapace
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /home/sander/local/node 
'configure' finished successfully (0.154s)
Waf: Entering directory `/home/sander/Development/haibu/node_modules/haibu-carapace/build'
[1/2] cxx: src/evref.cc -> build/default/src/evref_1.o
../src/evref.cc:1:21: error: node/ev.h: No such file or directory
../src/evref.cc:2:21: error: node/v8.h: No such file or directory
../src/evref.cc:4: error: ‘v8’ is not a namespace-name
../src/evref.cc:4: error: expected namespace-name before ‘;’ token
../src/evref.cc:6: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/evref.cc:11: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/evref.cc:17: error: variable or field ‘init’ declared void
../src/evref.cc:17: error: ‘Handle’ was not declared in this scope
../src/evref.cc:17: error: ‘Object’ was not declared in this scope
../src/evref.cc:17: error: ‘target’ was not declared in this scope
Waf: Leaving directory `/home/sander/Development/haibu/node_modules/haibu-carapace/build'
Build failed:  -> task failed (err #1): 
    {task: cxx evref.cc -> evref_1.o}

Got the same error when installing haibu-carapace standalone... :-(

When I changed the location of the includes in src/evref.cc from:

#include <node/ev.h>
#include <node/v8.h>

To:

#include <ev.h>
#include <v8.h>

I got everything working...

Any idea what is wrong with my node or npm setup ??

Thanks!!

PS: node v0.4.10 and npm 1.0.22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.