David Sutherland

Results 189 comments of David Sutherland

Added a back compat patch for: https://github.com/cylc/cylc-uiserver/issues/698 ![image](https://github.com/user-attachments/assets/e64355ee-b9ac-4c4e-a6ec-0cce0ab17594) (justification: https://github.com/cylc/cylc-uiserver/issues/698#issuecomment-3018637188)

Well it appears not to be the threading, I took the processing out of the thread and put the incoming deltas into a queue: ![Image](https://github.com/user-attachments/assets/ec2cec21-43e5-43fc-850e-2e3a8a8f71cf) (iterating over the queue with...

Maybe a memory leak in protobuf? There was one: https://github.com/protocolbuffers/protobuf/issues/10088 But that should be fixed at our version (4.24.4)

Removed threading altogether: https://github.com/cylc/cylc-uiserver/pull/683 But the memory accumulation is still present: ![Image](https://github.com/user-attachments/assets/adb90e30-8e4e-4625-b6f5-606b25158615)

So I've found the issue, it's with using long lived upb protobuf objects: https://github.com/protocolbuffers/protobuf/issues/19674 https://github.com/protocolbuffers/protobuf/issues/10294 If you use the python implementation by setting: `export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python` The `apply_delta` accumulation goes away:...

For example: ``` #!/usr/bin/python from time import sleep from cylc.flow.data_messages_pb2 import PbWorkflow from cylc.flow.data_store_mgr import reset_protobuf_object wbuf = PbWorkflow(id='this') wbuf2 = PbWorkflow(id='that', status='sprinting') while True: wbuf.status_msg = 'workflow is running'...

> The big problem is that this issue would appear to hit every single protobuf object? Which makes it rather difficult to defend against. Most protobuf objects are short-lived and...

Yes, I haven't seen this problem at NIWA since 8.5.0, It appears to have been to do with the old GraphQL/graphene library (< v3) .. Also the protobuf accumulation was...

> It doesn't quite make sense to me, but it does appear to work. > > Suggest keeping this PR open until the upstream PRs have been merged so it...

I was going to comment last week; having the number/count at a glance is a welcome improvement.. One thing, which is hinted by Hilary's [1050](https://github.com/cylc/cylc-ui/pull/1050) proposal, and then skipped over...