Skip to content

Commit

Permalink
Merge pull request #144 from chanchiem/thread_issue
Browse files Browse the repository at this point in the history
Poller threads block main thread from exiting bug #134
  • Loading branch information
chanchiem authored Mar 1, 2019
2 parents e4827a4 + da9b8a8 commit 744360d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion aws_xray_sdk/core/sampling/rule_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def __init__(self, cache, connector):
self._connector = connector

def start(self):
threading.Thread(target=self._worker).start()
poller_thread = threading.Thread(target=self._worker)
poller_thread.daemon = True
poller_thread.start()

def _worker(self):
frequency = 1
Expand Down
4 changes: 3 additions & 1 deletion aws_xray_sdk/core/sampling/target_poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def __init__(self, cache, rule_poller, connector):
self._interval = 10 # default 10 seconds interval on sampling targets fetch

def start(self):
threading.Thread(target=self._worker).start()
poller_thread = threading.Thread(target=self._worker)
poller_thread.daemon = True
poller_thread.start()

def _worker(self):
while True:
Expand Down

0 comments on commit 744360d

Please sign in to comment.