Timestamps in logs - GSOC 2025 #1151
Replies: 9 comments 16 replies
-
|
Hello and welcome to our project! Thanks for your interest! Using a pipe in principle solves #535. But we would not want to involve a shell here, because the more processes we start the more complex everything becomes. It should be handled completely inside BenchExec. For #536, the question is what works best in practice. For example, if the memfd solution really breaks I am always open for suggestions of other solutions, but all those that I became aware of are listed in the issue. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your quick response and detailed explanation! I understand your motivation to keep the complexity under control. In any case, I'll take a closer look at the code and try to submit some PRs if possible. Thanks! |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
|
We are really happy to be able to announce that @t0hsumi got accepted into GSoC with this project proposal! Congratulations! |
Beta Was this translation helpful? Give feedback.
-
Implementation plan detailHi @PhilippWendler , my current implementation plan uses non-blocking I/O and selectors. import subprocess
import selectors
import fcntl
import os
def add_nonblocking_flag(fd):
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
sel = selectors.DefaultSelector()
proc = subprocess.Popen(
["bash", "-c", 'echo "echo_stdout1" ; echo "echo_stderr1" 1>/dev/stderr ; echo "echo_stdout2"'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
add_nonblocking_flag(proc.stdout.fileno())
add_nonblocking_flag(proc.stderr.fileno())
sel.register(proc.stdout, selectors.EVENT_READ, data="STDOUT")
sel.register(proc.stderr, selectors.EVENT_READ, data="STDERR")
while True:
for key, _ in sel.select(): # Blocks until ready
data = os.read(key.fileobj.fileno(), 4096)
if not data:
sel.unregister(key.fileobj)
else:
print(f"[{key.data}] {data.decode().strip()}")
if proc.poll() is not None and not sel.get_map():
break
proc.stdout.close()
proc.stderr.close()
sel.close()I believe we don’t need to manage timeouts in this implementation. |
Beta Was this translation helpful? Give feedback.
-
Testing DetailCould you clarify how to evaluate the impact of the new feature on BenchExec? |
Beta Was this translation helpful? Give feedback.
-
Timeline updateHere is the updated timeline. I believe I can complete this project in 10 weeks.
|
Beta Was this translation helpful? Give feedback.
-
Progress Made up (Jun 21th)All the code is available on the branch add-output-selector. Current ProgressI implemented the pipe using In #1151 (reply in thread), my mentor, Dr. Philipp, asked me whether it is necessary to mark the file descriptors as non-blocking if we use them with Comparison to PlanAccording to my original plan, I aimed to finish the pipe implementation by the end of week 2, so currently the progress is behind schedule. I plan to allocate additional time to complete the implementation. ChallengesThere are the case where the current implementation doesn't work correctly, and I have a few questions. 1.
|
Beta Was this translation helpful? Give feedback.
-
Progress Made up (July 4th)All the code is available on the branch add-output-selector. Current ProgressI implemented the pipe using the Comparison to PlanI originally aimed to complete the pipe implementation by the end of week 4, so I'm currently about two weeks behind schedule. This week, I returned to Japan and couldn’t dedicate much time due to the flight and related matters. However, I’ll have more time to focus over the next couple of weeks. ChallengesI'm trying to implement the pipe without using Future PlanBy the end of week 6, I aim to complete the pipe implementation and move on to performance analysis. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@PhilippWendler I'm very interested in working on solving the timestamp issue as my GSoC 2025 project. I'll apply, but I have several questions:
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions