Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pausing never occurs #21

Open
Jonsofmath opened this issue Sep 14, 2021 · 3 comments
Open

Pausing never occurs #21

Jonsofmath opened this issue Sep 14, 2021 · 3 comments

Comments

@Jonsofmath
Copy link

I was running a simple project with mutate_cpp but, apparently, when i hit the "pause" button, the pausing never occurs and the button freezes in "pausing", so i can't run again other patches. Thanks in advice.

@AlexisWilke
Copy link
Contributor

I have the same issue. I know which mutation is causing the issue and in my case it looks like it loops forever. Probably a similar issue on your end. It should stop when the timeout is reached (assuming you added such).

@AlexisWilke
Copy link
Contributor

Okay, not quite true, I guess...

I made changes to the code so it wouldn't loop forever even when used with the wrong operator, but then resume would fail (and pause break) because the server generates an error and I guess the state is then invalid. Here is the error:

127.0.0.1 - - [12/Aug/2023 06:51:35] "GET /queue/start HTTP/1.1" 302 -
Exception in thread Thread-24 (main):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 42, in main
    self.workflow(patch)
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 89, in workflow
    self.__execute_command_timeout('patch -p1 --input={patchfile} {inputfile}'.format(patchfile=patchfile.name, inputfile=file.filename), cwd='/')
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 71, in __execute_command_timeout
    raise subprocess.CalledProcessError(errcode, command, stdout)
subprocess.CalledProcessError: Command 'patch -p1 --input=/tmp/tmp4xhw5to2 /home/snapwebsites/snapcpp/contrib/as2js/as2js/types/string.cpp' returned non-zero exit status 1.

a.k.a. the patch command failed and as the result an exception occurred and I suspect that the state is then invalid. For the patch to fail, I just had to edit the file around the line that the patch attempts to update. I understand I have to regenerate the files, but that should be an error reported to the user in the website rather than an error in the server.

@AlexisWilke
Copy link
Contributor

AlexisWilke commented Aug 12, 2023

Note that I also had an invalid path to my "quick check" and that would also result in a python exception and that would cause the whole thing to stop working. Both of those potential exceptions should be easy for you to reproduce and capture and somehow emit an error message to the end user?

Exception in thread Thread-81 (main):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 42, in main
    self.workflow(patch)
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 93, in workflow
    self.__apply_command(patch, 'quickcheck_command') and \
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 139, in __apply_command
    output = self.__execute_command_timeout(command, cwd=patch.project.workdir, timeout=timeout)
  File "/home/alexis/tools/mutate_cpp/app/utils/Executor.py", line 46, in __execute_command_timeout
    proc = subprocess.Popen(shlex.split(command), stdin=stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/snapwebsites/snapcpp/BUILD/Debug/contrib/as2jsw/tools/as2js'

Here I can see that it says "Thread 81" and I would imagine that this is "silently" running on the server side. I guess the best in this case could be to create a table in SQLite that has error messages from the backend. When you reload a page on the front end, check that table and display those messages. Best to have an X to allow the user to explicitly discard the message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants