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

during cleanup when leftover is in directory, try again #1058

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

xsuchy
Copy link
Member

@xsuchy xsuchy commented Apr 14, 2023

When you Ctrl+C a child can still write something in directory, so try again. Previously this lead to traceback as we handled only this situation when the data were excluded.

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2186613

if exclude: # but it is excluded
pass
else: # likely during Ctrl+C something additional data
try_again = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this could go into an infinite loop. Don't you want to give it some reasonable timeframe?

Resolves: RHBZ#1957384

When you Ctrl+C a child can still write something in directory, so try again.
Previously this lead to traceback as we handled only this situation when the data were excluded.
@xsuchy
Copy link
Member Author

xsuchy commented Apr 19, 2023

Updated.

@praiskup
Copy link
Member

praiskup commented May 4, 2023

Honestly, spending tens of minutes on the review, I fail to concentrate enough (tried several times) :-) I can't get myself comfortable with the rmtree() method. So I'm neutral on merging or not merging.

The CTRL+C is not properly handled; if KeyboardInterrupt is raised, we don't do any special tasks - so I fail to confirm that it actually makes any sense to wait a bit here.

It would be an interesting task to get rid of the custom rmtree() method. It shouldn't be needed at all (except for maybe the chattr hack). The thing is that these hacks/retries are here to solve some other issue with Mock code that should be fixed.

@praiskup
Copy link
Member

By coincidence, I faced an in-ubi8 situation after failed cpio.src.rpm testsuite failure:

$ mock -r fedora-rawhide-x86_64 --scrub=all
...
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/file_util.py", line 60, in rmtree
    rmtree(fullname, selinux=selinux, exclude=exclude)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/file_util.py", line 60, in rmtree
    rmtree(fullname, selinux=selinux, exclude=exclude)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/file_util.py", line 60, in rmtree
    rmtree(fullname, selinux=selinux, exclude=exclude)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/file_util.py", line 60, in rmtree
    rmtree(fullname, selinux=selinux, exclude=exclude)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/file_util.py", line 60, in rmtree
    rmtree(fullname, selinux=selinux, exclude=exclude)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/file_util.py", line 60, in rmtree
    rmtree(fullname, selinux=selinux, exclude=exclude)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 88, in trace
    func=frame.f_code.co_name)
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 39, in doLog
    logger.handle(logger.makeRecord(logger.name, level, *args, **kargs))
  File "/usr/lib64/python3.6/logging/__init__.py", line 1413, in makeRecord
    sinfo)
  File "/usr/lib64/python3.6/logging/__init__.py", line 277, in __init__
    if (args and len(args) == 1 and isinstance(args[0], collections.Mapping)
  File "/usr/lib64/python3.6/abc.py", line 184, in __instancecheck__
    if subclass in cls._abc_cache:
RecursionError: maximum recursion depth exceeded

export MOCK_TRACE_LOG=false helped eventually.

@xsuchy
Copy link
Member Author

xsuchy commented Jul 17, 2023

The last necessary bit was done in #1139
So merging as it is.

@xsuchy xsuchy merged commit 99276bd into rpm-software-management:main Jul 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants