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

(maint) Fix bugs from redis and timeout notification updates. #621

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/vmpooler/api/v3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,9 @@ def component_to_test(match, labels_string)
def update_user_metrics(operation, vmname)
tracer.in_span("Vmpooler::API::V3.#{__method__}") do |span|
begin
backend.multi
backend.hget("vmpooler__vm__#{vmname}", 'tag:jenkins_build_url')
backend.hget("vmpooler__vm__#{vmname}", 'token:user')
backend.hget("vmpooler__vm__#{vmname}", 'template')
jenkins_build_url, user, poolname = backend.exec
jenkins_build_url = backend.hget("vmpooler__vm__#{vmname}", 'tag:jenkins_build_url')
user = backend.hget("vmpooler__vm__#{vmname}", 'token:user')
poolname = backend.hget("vmpooler__vm__#{vmname}", 'template')
poolname = poolname.gsub('.', '_')

if user
Expand Down
2 changes: 2 additions & 0 deletions lib/vmpooler/pool_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def fail_pending_vm(vm, pool, timeout, timeout_notification, redis, exists: true
already_timed_out = time_since_clone > timeout
timing_out_soon = time_since_clone > timeout_notification && !redis.hget("vmpooler__vm__#{vm}", 'timeout_notification')

return true if !already_timed_out && !timing_out_soon
yachub marked this conversation as resolved.
Show resolved Hide resolved

if already_timed_out
unless exists
remove_nonexistent_vm(vm, pool, redis)
Expand Down