Skip to content

http2: close not emitted when receiving RST_STREAM after DATA #27863

@mildsunrise

Description

@mildsunrise
  • Version: latest master
  • Platform: Linux 4.4.0-142-generic 168-Ubuntu SMP Wed Jan 16 2019 x86_64 GNU/Linux
  • Subsystem: http2
const server = http2.createServer();
server.on('stream', (stream) => {
  stream.respond();
  stream.write('test');
  // Wait for DATA to be sent, then send RST_STREAM
  setTimeout(() => stream.close(), 200);
});

server.listen(() => {
  const client = http2.connect({ protocol: 'http:', ...server.address() });
  const req = client.request({ ':path': '/' });
  req.end();
  req.on('close', () => {
    // Never called
  });
});

I can verify that RST_STREAM is sent to the client, but close is never emitted. Is this expected?
If the write is removed, close is emitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues or PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions