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

fix:Race condition on instance variable assignment #1154

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions lib/ddtrace/workers/async.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def terminate
end

def run_async?
@run_async = false unless instance_variable_defined?(:@run_async)
return false unless instance_variable_defined?(:@run_async)
@run_async == true
end

Expand All @@ -55,7 +55,7 @@ def running?
end

def error?
@error = nil unless instance_variable_defined?(:@error)
return false unless instance_variable_defined?(:@error)
!@error.nil?
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ddtrace/workers/loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def work_pending?
end

def run_loop?
@run_loop = false unless instance_variable_defined?(:@run_loop)
return false unless instance_variable_defined?(:@run_loop)
@run_loop == true
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ddtrace/workers/polling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def stop(force_stop = false, timeout = SHUTDOWN_TIMEOUT)
end

def enabled?
@enabled = true unless instance_variable_defined?(:@enabled)
return true unless instance_variable_defined?(:@enabled)
@enabled
end

Expand Down