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

Tcp_conn_validator doesn't respect timeout if the connection is dropped #85

Open
gmenuel opened this issue Mar 6, 2024 · 0 comments
Open

Comments

@gmenuel
Copy link

gmenuel commented Mar 6, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.26.0
  • Ruby: 2.7.8p225
  • Distribution: Debian 10
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

time puppet apply --debug -e "tcp_conn_validator { '1.2.3.4:443': timeout => 10}"

What are you seeing

The Tcp_conn_validator resource takes 2 minutes to execute.

What behaviour did you expect instead

The Tcp_conn_validator should fail after 10 seconds.

Output log

[...]
Info: Applying configuration version '1709733218'
Notice: Failed to connect to the host within timeout window of 10 seconds; giving up.
Error: Unable to connect to the  host. (1.2.3.4:443)
Error: /Stage[main]/Main/Tcp_conn_validator[1.2.3.4:443]/ensure: change from 'absent' to 'present' failed: Unable to connect to the  host. (1.2.3.4:443)
Debug: Class[Main]: Resource is being skipped, unscheduling all events
Debug: Stage[main]: Resource is being skipped, unscheduling all events
Debug: Finishing transaction 12780
Debug: Storing state
Debug: Pruned old state cache entries in 0.00 seconds
Debug: Stored state in 0.01 seconds
Notice: Applied catalog in 120.12 seconds
[...]

Any additional information you'd like to impart

The 2 minutes timeout seems to be the http_connect_timeout of Puppet, which is used in https://github.com/voxpupuli/puppet-healthcheck/blob/master/lib/puppet_x/puppet-community/tcp_validator.rb#L31 . I think this timeout should at least be configurable. And it should be at most the timeout of the Tcp_conn_resource.

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