AcademySoftwareFoundation / OpenCue

A render management system you can deploy for visual effects and animation productions.
https://www.opencue.io
Apache License 2.0
830 stars 201 forks source link

Issue on log parsing logic implemented by PR#1335 #1426

Closed DiegoTavares closed 1 month ago

DiegoTavares commented 3 months ago

The new parsing logic implemented by #1335 has an issue when it comes to consuming lines from stdout and stderr in the following loops:

         with open(self.rqlog.name, 'a') as f:
                # Convert to ASCII while discarding characters that can not be encoded
                for line in frameInfo.forkedCommand.stdout:
                    line = line.encode('ascii', 'ignore')
                    f.write(line.decode('ascii') + '\n')
                for line in frameInfo.forkedCommand.stderr:
                    line = line.encode('ascii', 'ignore')
                    f.write(line.decode('ascii') + '\n')

This logic has to wait until all content of stdout is consumed before consuming content from stderr, which means users monitoring the logs of running jobs will not have a real-time feed of what the job is doing. Besides that, a failure might cause the process to exit before giving it the change to have the content of stderr processed.

https://github.com/AcademySoftwareFoundation/OpenCue/blob/688425ce859f183126ab8235543e4b0a13ff6c50/rqd/rqd/rqcore.py#L342

DiegoTavares commented 3 months ago

FYI @ramonfigueiredo

ramonfigueiredo commented 3 months ago

FYI @ramonfigueiredo

Ok. I'll take a look on that asap.

Thanks!

ramonfigueiredo commented 3 months ago

@DiegoTavares

I created a new PR to fix this problem. See the PR https://github.com/AcademySoftwareFoundation/OpenCue/pull/1427