Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel stops accepting puts #72

Open
rhasson opened this issue Oct 23, 2015 · 0 comments
Open

Channel stops accepting puts #72

rhasson opened this issue Oct 23, 2015 · 0 comments

Comments

@rhasson
Copy link

rhasson commented Oct 23, 2015

Hi,

I'm running into an obscure issue that I can't figure out. So I set up a inbound channel that takes HTTP requests coming from a client. Then I take those requests off the channel, process them and put them back onto an outbound channel. The server then takes the modified requests off the outbound channel and replies back to the client. When I send 2 or more concurrent requests to the server, the outbound channel becomes corrupt after 2 puts.

This is what the outbound channel looks like BEFORE any requests are sent:
utbound
{ buf:
{ buf: { length: 0, array: [Object], head: 0, tail: 0 },
n: 100 },
xform:
{ '@@transducer/step': [Function],
'@@transducer/result': [Function] },
takes:
{ length: 1,
array: [ [Object], , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ],
head: 1,
tail: 0 },
puts:
{ length: 0,
array: [ , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ],
head: 0,
tail: 0 },
dirty_takes: 1,
dirty_puts: 0,
closed: false }

And this is what it looks like AFTER 2 concurrent requests:
outbound
{ buf:
{ buf: { length: 0, array: [Object], head: 2, tail: 2 },
n: 100 },
xform:
{ '@@transducer/step': [Function],
'@@transducer/result': [Function] },
takes:
{ length: 0,
array: [ null, null, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ],
head: 2,
tail: 2 },
puts:
{ length: 0,
array: [ , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ],
head: 0,
tail: 0 },
dirty_takes: 2,
dirty_puts: 0,
closed: false }

The only difference I can tell is that when this issue happens the "takes" array is missing the object at the end of it. If I issue requests manually the array grows as I expect and that object remains at the end of the array.

My code is in this gist: https://gist.github.com/rhasson/0460a2b261cf5422ec8f

The way to reproduce this problem is to run Apache Bench with concurrency of 2 or more, for example:

ab -n 4 -c 2 -p incomingcall.json -T 'application/json' -m POST http://localhost:9000/actions

Thanks,
Roy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant