Skip to content

Limit maximum size ATS can read from net at a time in SSL read loop#2247

Closed
maskit wants to merge 1 commit intoapache:masterfrom
maskit:inactive_timeout2
Closed

Limit maximum size ATS can read from net at a time in SSL read loop#2247
maskit wants to merge 1 commit intoapache:masterfrom
maskit:inactive_timeout2

Conversation

@maskit
Copy link
Member

@maskit maskit commented Jul 7, 2017

Limit maximum size ATS can read from net at a time in SSL read loop. Hopefully avoids timeouts during POST.

@maskit maskit added this to the 7.1.0 milestone Jul 7, 2017
@maskit
Copy link
Member Author

maskit commented Jul 7, 2017

I don't think the value should be hardcoded. Using loop count is an option too. The point is that we need to break out from this loop somehow without any errors at times.

@scw00
Copy link
Member

scw00 commented Jul 7, 2017

IMOH, there is a little problem .

After discussed with @oknet, this logic seems to be the same as #629.

We only fill one block in the original logic and then call user

block_write_avail = b->write_avail();

After #629
We always append block if ntodo not 0.

@oknet
Copy link
Member

oknet commented Jul 7, 2017

The NetHandler is designed to:

  1. Only read() one block of data and then call Continuation ( if watermark set to 0 ).
  2. The Continuation consume data and reenable the read VIO and return.
  3. The vc->read.triggered is set to 0 if EAGAIN returned from read()
  4. Go to step 1 if next NetVC not null and vc->read.triggered is 1.

After #629 merged, the ssl_read_from_net() will read and attach IOBufferBlock(s) until EAGAIN.
It makes NetHandler stall on reading loop and cannot going to the sending loop.

}
int64_t block_write_avail = buf.writer()->block_write_avail();
if (block_write_avail <= 0) {
buf.writer()->add_block();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether or not add a new block , It is controlled by the watermark of MIOBuffer.
Just break out here if buf.write_avail() less than 0.

@maskit
Copy link
Member Author

maskit commented Jul 7, 2017

Thanks for the comments. Discussion will be continued on #2248.

@maskit maskit closed this Jul 7, 2017
@zwoop zwoop removed this from the 7.1.0 milestone Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants