Skip to content

Conversation

@Jongy
Copy link
Contributor

@Jongy Jongy commented Apr 28, 2022

This gives JattachTimeout exception name (plus more nice details) to timeout of jattach, to differentiate them from other JattachExceptions.

Here's how it looks:

[2022-04-28 14:26:52,286] ERROR: gprofiler.profilers.profiler_base: JavaProfiler: failed to profile process 576776 (java)
Traceback (most recent call last):
  File "/app/gprofiler/profilers/profiler_base.py", line 139, in snapshot
    result = future.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/gprofiler/profilers/java.py", line 843, in _profile_process
    return ProfileData(self._profile_process_stackcollapse(process), appid, app_metadata)
  File "/app/gprofiler/profilers/java.py", line 837, in _profile_process_stackcollapse
    return self._profile_ap_process(ap_proc, comm)
  File "/app/gprofiler/profilers/java.py", line 846, in _profile_ap_process
    started = ap_proc.start_async_profiler(self._interval, ap_timeout=self._ap_timeout)
  File "/app/gprofiler/profilers/java.py", line 468, in start_async_profiler
    self._run_async_profiler(start_cmd)
  File "/app/gprofiler/profilers/java.py", line 443, in _run_async_profiler
    raise JattachTimeout(*args, timeout=self._jattach_timeout) from None
gprofiler.profilers.java.JattachTimeout: Command '['/app/gprofiler/resources/java/jattach', '576776', 'load', '/tmp/gprofiler_tmp/async-profiler-v2.7g2/glibc/libasyncProfiler.so', 'true', 'start,event=cpu,file=/tmp/gprofiler_tmp/tmppmr9ca53/async-profiler-576776.output,collapsed,ann,sig,interval=10101010,log=/tmp/gprofiler_tmp/tmppmr9ca53/async-profiler-576776.log,fdtransfer,safemode=64,timeout=35']' died with <Signals.SIGTERM: 15>.
stdout: b''
stderr: b''
Java PID: 576776
async-profiler DSO was loaded
async-profiler log:
(empty)
jattach timed out (timeout was 30 seconds); you can increase it with the --java-jattach-timeout parameter.

In another PR I shall add identification of attach socket missing, which is also a common case.

@Jongy Jongy merged commit f09564d into master May 1, 2022
@Jongy Jongy deleted the jattach-nicer-errors branch May 1, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request runtime/java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants