Skip to content

zlib(finalizer): the stream was freed prematurely. when using compression #342

@mfazekas

Description

@mfazekas
require 'sshkit'
require 'sshkit/dsl'

SSHKit::Backend::Netssh.config.ssh_options = {compression: true, compression_level: 9}

on 'localhost' do
  ls_output = capture(:ls, '-l')
end

It outputs:

...
zlib(finalizer): the stream was freed prematurely.

the issue is that sshkit doesn't close the net-ssh connection which then cannot close the zlib stream which has finalizer and complains.

as a workaround

SSHKit::Backend::Netssh.pool.close_connections

can be added thanks to #285
see also net-ssh/net-ssh#284

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions