nodepp icon indicating copy to clipboard operation
nodepp copied to clipboard

Calls via express are not queued

Open somebee opened this issue 10 years ago • 6 comments

It seems to me that there must be something wrong with the node-epp-server. When you send a request to it while another request is being handled, the server will immediately return with status 400, "Unknown registry". Is it intentional that you cannot send in another request until you know that the registry worker is available?

Or is it a bug? If it is a bug, I guess it's the fact that you don't clone the object of registries in https://github.com/heytrav/nodepp/blob/master/lib/listener.js#L7. This means that the worker is removed from availableProcesses when busy, resulting in the immediate return for requests https://github.com/heytrav/nodepp/blob/master/lib/node-epp-server.js#L67-L72.

somebee avatar Oct 20 '15 13:10 somebee

Ok, thanks for the heads up. I'll have a look.

heytrav avatar Oct 20 '15 17:10 heytrav

@somebee I sent a message to your email address regarding this issue.

heytrav avatar Oct 20 '15 23:10 heytrav

I see the same thing, I login, success, try to create contact, contact already exits, then next request happens, but returns nothing but unknown reg because availableprocess is empty object.

chrisschaub avatar Nov 21 '16 19:11 chrisschaub

try to create contact, contact already exits

So is the connection being lost due to an error?

Sorry I did not get around to implementing any type of queue. At the time I was more focused on queueing commands outside of nodepp via external logic and RabbitMQ. I also felt that creating too much complexity in nodepp was outside its scope as an EPP communication service. I admit, I might be misunderstanding the actual problem though. I will hopefully be getting a bit more backing to start work on this soon, so will try to have a look and see what can be done.

As far as I know, communication through a particular EPP worker must be serialized as registries offer a limited number of connections. Some, like EURID, used to penalize with hit points for attempting to open too many connections at a time (and block us for 24 h when we had too many). Hence, cloning a worker to create a new connection for each command is not a good idea. I have never attempted to send multiple commands to an EPP server before getting a response, so I'm not totally sure how well that will work.

heytrav avatar Nov 21 '16 20:11 heytrav

Connection is fine, I think the issue is that the registry is not "free" because a command is being run. And so the queue of commands doesn't stack up, the available registry object is empty until the requests reports back as free. I think one connection is safe as well. I think this is because the availableRegistries is empty and so the child commands don't queue, they just return unknown registry until the childFree happens and puts it back. The code looks like it supports and stacking of child events, runs them in order, one connection?

On Mon, Nov 21, 2016 at 2:32 PM, William Travis Holton < [email protected]> wrote:

try to create contact, contact already exits

So is the connection being lost due to an error?

Sorry I did not get around to implementing any type of queue. At the time I was more focused on queueing commands outside of nodepp via external logic and RabbitMQ. At the time, I also felt that creating too much complexity in nodepp was outside its scope as an EPP communication service. However I will hopefully be getting a bit more backing to start work on this soon, so will try to have a look and see what can be done.

As far as I know, communication through a particular EPP worker must be serialized as registries offer a limited number of connections. Some, like EURID, used to penalize with hit points for attempting to open too many connections at a time (and block us for 24 h when we had too many).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/heytrav/nodepp/issues/2#issuecomment-262058662, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKssAm06EALXN17HEQBo7BtllATA8sqks5rAf_0gaJpZM4GSKXj .

Christopher Schaub http://chris.schaub.com

chrisschaub avatar Nov 21 '16 20:11 chrisschaub

The code looks like it supports and stacking of child events, runs them in order, one connection?

I'll have a look.

I know it's not a fix really, but it should also be possible to start multiple instances of nodepp service and round robin the commands. As far as I know, most registries do allow > 1 connection. The simple hacky way I did this in the past was just to duplicate the config as a second registry with a name like "registry-2" and start nodepp with the extra registry option (eg. -r registry -r registry-2) (YMMV).

heytrav avatar Nov 21 '16 21:11 heytrav