awslabs / aws-c-http

C99 implementation of the HTTP/1.1 and HTTP/2 specifications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Double task scheduling when aws_http1_stream_write_chunk() is used.

chehefen opened this issue · comments

aws_http1_stream_write_chunk() triggers outgoing_stream_task to be scheduled here: https://github.com/awslabs/aws-c-http/blob/master/source/h1_connection.c#L441. However, outgoing_stream_task could also be scheduled here: https://github.com/awslabs/aws-c-http/blob/master/source/h1_connection.c#L870. These two together can cause the double scheduling of the outgoing_stream_task and cause some linklist assertion to fail when aws_http1_stream_write_chunk is called. In my case, second aws_http1_stream_write_chunk() call fails after first aws_http1_stream_write_chunk call has completed successfully.

Fixed in master!
thanks for the excellent diagnosis