Revert "VOL-669 Openolt adapter - Fix a race condition in indication processing."
This reverts commit 87ea8d5a3690b4a9d955c989dcf58630f4f088a6.
Change-Id: Iabf538cdf32af9c0c3d3c4353c36e0e79713705d
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 45faf77..804bc0e 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -84,21 +84,18 @@
device.oper_status = OperStatus.ACTIVATING
self.adapter_agent.update_device(device)
-
# Initialize gRPC
self.channel = grpc.insecure_channel(self.host_and_port)
- self.channel_ready_future = grpc.channel_ready_future(self.channel)
+ self.stub = openolt_pb2_grpc.OpenoltStub(self.channel)
# Start indications thread
- self.indications_thread = threading.Thread(target=self.process_indications)
+ self.indications_thread = threading.Thread(target=self.process_indication)
self.indications_thread.daemon = True
self.indications_thread.start()
- def process_indications(self):
- self.channel_ready_future.result() # blocks till gRPC connection is complete
- self.stub = openolt_pb2_grpc.OpenoltStub(self.channel)
+ def process_indication(self):
self.indications = self.stub.EnableIndication(openolt_pb2.Empty())
- while True:
+ while 1:
# get the next indication from olt
ind = next(self.indications)
self.log.debug("rx indication", indication=ind)