Skip to content

Commit

Permalink
remote: reduce debug output
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Luebbe <[email protected]>
  • Loading branch information
jluebbe committed Jun 13, 2024
1 parent 612b1eb commit e914dd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions labgrid/remote/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,11 @@ async def queue_as_aiter(q):
try:
while True:
item = await q.get()
logging.info(f"queue_as_aiter item {item}")
if item is None:
return
yield item
q.task_done()
print(f"sent {item}")
logging.debug(f"sent message {item}")
except Exception:
logging.exception("error in queue_as_aiter")
raise
1 change: 0 additions & 1 deletion labgrid/remote/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,6 @@ async def request_task():
await self._update_acquired_places(action, resource, callback=False)

logging.debug(f"exporter aborted {context.peer()}, cancelled: {context.cancelled()}")
logging.debug("Exporters: %s", self.exporters)

async def AcquirePlace(self, request, context):
peer = context.peer()
Expand Down
7 changes: 2 additions & 5 deletions labgrid/remote/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ async def message_pump(self):
try:
async for out_message in self.stub.ExporterStream(queue_as_aiter(self.out_queue)):
got_message = True
logging.debug(f"out_message {out_message}")
logging.debug(f"received message {out_message}")
kind = out_message.WhichOneof("kind")
if kind == "hello":
logging.info("connected to exporter version %s", out_message.hello.version)
Expand Down Expand Up @@ -929,15 +929,12 @@ async def add_resource(self, group_name, resource_name, cls, params):
async def update_resource(self, group_name, resource_name):
"""Update status on the coordinator"""
resource = self.groups[group_name][resource_name]
print(resource)
data = resource.asdict()
print(data)
msg = labgrid_coordinator_pb2.ExporterInMessage()
msg.resource.CopyFrom(resource.as_pb2())
msg.resource.path.group_name = group_name
msg.resource.path.resource_name = resource_name
print(f"encoded {msg}")
self.out_queue.put_nowait(msg)
logging.info("queued update for resource %s/%s", group_name, resource_name)


async def amain(config) -> bool:
Expand Down

0 comments on commit e914dd1

Please sign in to comment.