Bug 1189617 - view_anymsg runs too long and hangs
view_anymsg runs too long and hangs
Status: CONFIRMED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: YaST2
Current
x86-64 openSUSE Tumbleweed
: P5 - None : Normal with 1 vote (vote)
: ---
Assigned To: YaST Team
Jiri Srain
https://trello.com/c/ZMy1XWOT
:
Depends on: 1189647
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-19 14:53 UTC by Christopher Yeleighton
Modified: 2022-10-06 16:59 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
save_y2logs (9.24 MB, application/x-xz)
2021-08-19 16:41 UTC, Christopher Yeleighton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Yeleighton 2021-08-19 14:53:46 UTC
{ ps ww 12408; }
PID TTY      STAT   TIME COMMAND
12408 ?        Sl    17:16 /usr/bin/ruby.ruby2.7 --encoding=utf-8 /usr/lib/YaST2/bin/y2start view_anymsg --arg /var/log/zypp/history qt -name YaST2 -icon yast  

The YaST window does not refresh.
Comment 1 David Diaz 2021-08-19 15:38:21 UTC
Hi Christopher!

Thanks a lot for the report, but I cannot understand what problem you're facing. I'm sorry. Could you please describe it in plain English?

Additionally, please attach the YaST logs. To collect them run 'save_y2logs' and attach the log file archive this command creates (usually named /tmp/y2log-SOMETHING.tar.xz).

For more information, please have a look at https://en.opensuse.org/openSUSE:Report_a_YaST_bug#logfiles

*** Important ***

When done, please remove the 'needinfo' flag. Otherwise, the attachment might not be noticed.
Comment 2 Christopher Yeleighton 2021-08-19 16:41:40 UTC
Created attachment 851932 [details]
save_y2logs
Comment 3 Christopher Yeleighton 2021-08-19 16:52:04 UTC
There are 2 problems:
1. It should not take TIME=75:10 to load a log file weighing 9 MB.
2. The controller should not freeze while the model is loading.
Comment 4 Josef Reidinger 2021-08-20 06:04:40 UTC
(In reply to Christopher Yeleighton from comment #3)
> There are 2 problems:
> 1. It should not take TIME=75:10 to load a log file weighing 9 MB.

I cannot reproduce it here. For me it takes few seconds. Do you have enough memory? As we load content of file to memory and then pass it, so it is used several times.

another option is to try profile 
so run again module with
Y2PROFILER=1 yast2 view_anymsg /var/log/zypp/history

and attach /var/log/YaST2/profiler_result.txt

For me, majority of time took passing file content from ruby to ycp and to qt.

another option to try is 

yast view_anymsg /var/log/zypp/history

which should run ncurses backend ( if you have it installed ) to check that problem is not in graphical part/qt.

> 2. The controller should not freeze while the model is loading.

This is result of not having file loading asynchronous. So it does not freeze, but it does not react due to having main thread occupied by file loading ( or passing that value to qt ). I worry that currently we have enough issues to not introduce threads or asynchronous operations.
Comment 5 Christopher Yeleighton 2021-08-20 06:56:26 UTC
(In reply to Josef Reidinger from comment #4)
> (In reply to Christopher Yeleighton from comment #3)
> > There are 2 problems:
> > 1. It should not take TIME=75:10 to load a log file weighing 9 MB.
> 
> I cannot reproduce it here. For me it takes few seconds. Do you have enough
> memory? As we load content of file to memory and then pass it, so it is used
> several times.
> 
> another option is to try profile 
> so run again module with
> Y2PROFILER=1 yast2 view_anymsg /var/log/zypp/history
> 
> and attach /var/log/YaST2/profiler_result.txt


Internal error. Please report a bug report with logs.
Run save_y2logs to get complete logs.

Caller: /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'

Details: cannot load such file -- profiler
Comment 6 Josef Reidinger 2021-08-20 08:33:29 UTC
(In reply to Christopher Yeleighton from comment #5)
> (In reply to Josef Reidinger from comment #4)
> > (In reply to Christopher Yeleighton from comment #3)
> > > There are 2 problems:
> > > 1. It should not take TIME=75:10 to load a log file weighing 9 MB.
> > 
> > I cannot reproduce it here. For me it takes few seconds. Do you have enough
> > memory? As we load content of file to memory and then pass it, so it is used
> > several times.
> > 
> > another option is to try profile 
> > so run again module with
> > Y2PROFILER=1 yast2 view_anymsg /var/log/zypp/history
> > 
> > and attach /var/log/YaST2/profiler_result.txt
> 
> 
> Internal error. Please report a bug report with logs.
> Run save_y2logs to get complete logs.
> 
> Caller: /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in
> `require'
> 
> Details: cannot load such file -- profiler

Ah, ruby 2.7 removed profiler, thats why I do not see it :(

https://github.com/ruby/ruby/blob/d92f09a5eea009fa28cd046e9d0eb698e3d94c5c/doc/NEWS-2.7.0#label-Stdlib+compatibility+issues+-28excluding+feature+bug+fixes-29

I worry we need to find new way how to profile yast code. Advantage of profiler was that it was part of standard ruby, so it is not external dependency.
Comment 7 Christopher Yeleighton 2021-08-20 11:15:44 UTC
(In reply to Josef Reidinger from comment #6)
> (In reply to Christopher Yeleighton from comment #5)
> > (In reply to Josef Reidinger from comment #4)
> > > Y2PROFILER=1 yast2 view_anymsg /var/log/zypp/history
> > > 
> > > and attach /var/log/YaST2/profiler_result.txt
> > 
> > 
> > Internal error. Please report a bug report with logs.
> > Run save_y2logs to get complete logs.
> > 
> > Caller: /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in
> > `require'
> > 
> > Details: cannot load such file -- profiler
> 
> Ah, ruby 2.7 removed profiler, thats why I do not see it :(
> 
> https://github.com/ruby/ruby/blob/d92f09a5eea009fa28cd046e9d0eb698e3d94c5c/
> doc/NEWS-2.7.0#label-Stdlib+compatibility+issues+-
> 28excluding+feature+bug+fixes-29
> 
> I worry we need to find new way how to profile yast code. Advantage of
> profiler was that it was part of standard ruby, so it is not external
> dependency.

What Y2PROFILER=1 now does is a bug in itself.
Comment 8 Josef Reidinger 2021-08-20 12:18:18 UTC
(In reply to Christopher Yeleighton from comment #7)
> (In reply to Josef Reidinger from comment #6)
> > (In reply to Christopher Yeleighton from comment #5)
> > > (In reply to Josef Reidinger from comment #4)
> > > > Y2PROFILER=1 yast2 view_anymsg /var/log/zypp/history
> > > > 
> > > > and attach /var/log/YaST2/profiler_result.txt
> > > 
> > > 
> > > Internal error. Please report a bug report with logs.
> > > Run save_y2logs to get complete logs.
> > > 
> > > Caller: /usr/lib64/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in
> > > `require'
> > > 
> > > Details: cannot load such file -- profiler
> > 
> > Ah, ruby 2.7 removed profiler, thats why I do not see it :(
> > 
> > https://github.com/ruby/ruby/blob/d92f09a5eea009fa28cd046e9d0eb698e3d94c5c/
> > doc/NEWS-2.7.0#label-Stdlib+compatibility+issues+-
> > 28excluding+feature+bug+fixes-29
> > 
> > I worry we need to find new way how to profile yast code. Advantage of
> > profiler was that it was part of standard ruby, so it is not external
> > dependency.
> 
> What Y2PROFILER=1 now does is a bug in itself.

agreed. It is not related bug.
Comment 9 David Diaz 2021-08-23 07:43:37 UTC
Let's track this only for digging a bit more on the loading time issue when running Qt, since the threads or asynchronous operations will not be introduced in a short/mid-term and there is a bug report open for the profiler.

Thank you guys!
Comment 10 Christopher Yeleighton 2022-10-06 16:59:25 UTC
A possible workaround: { systemctl stop snapperd; }