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

java: Raise JattachSocketMissing if the attach socket is missing (HS only for now) #354

Merged
merged 3 commits into from
May 1, 2022

Conversation

Jongy
Copy link
Contributor

@Jongy Jongy commented Apr 29, 2022

Based on #352

After removing /tmp/.java_pidX:

[2022-04-29 18:36:37,267] DEBUG: gprofiler.utils: (['/app/gprofiler/resources/java/jattach', '691779', 'load', '/tmp/gprofiler_tmp/async-profiler-v2.7g2/glibc/libasyncProfiler.so', 'true', 'start,event=cpu,file=/tmp/gprofiler_tmp/tmpk8bcej93/async-profiler-691779.output,collapsed,ann,sig,interval=10101010,log=/tmp/gprofiler_tmp/tmpk8bcej93/async-profiler-691779.log,fdtransfer,safemode=64,timeout=35']) stderr: 'Could not start attach mechanism: No such file or directory\n'
[2022-04-29 18:36:37,267] ERROR: gprofiler.profilers.profiler_base: JavaProfiler: failed to profile process 691779 (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 854, in _profile_process
    return ProfileData(self._profile_process_stackcollapse(process), appid, app_metadata)
  File "/app/gprofiler/profilers/java.py", line 848, in _profile_process_stackcollapse
    return self._profile_ap_process(ap_proc, comm)
  File "/app/gprofiler/profilers/java.py", line 857, in _profile_ap_process
    started = ap_proc.start_async_profiler(self._interval, ap_timeout=self._ap_timeout)
  File "/app/gprofiler/profilers/java.py", line 479, in start_async_profiler
    self._run_async_profiler(start_cmd)
  File "/app/gprofiler/profilers/java.py", line 454, in _run_async_profiler
    raise JattachSocketMissing(*args) from None
gprofiler.profilers.java.JattachSocketMissing: Command '['/app/gprofiler/resources/java/jattach', '691779', 'load', '/tmp/gprofiler_tmp/async-profiler-v2.7g2/glibc/libasyncProfiler.so', 'true', 'start,event=cpu,file=/tmp/gprofiler_tmp/tmpk8bcej93/async-profiler-691779.output,collapsed,ann,sig,interval=10101010,log=/tmp/gprofiler_tmp/tmpk8bcej93/async-profiler-691779.log,fdtransfer,safemode=64,timeout=35']' returned non-zero exit status 1. 
stdout: b''
stderr: b'Could not start attach mechanism: No such file or directory\n'
Java PID: 691779
async-profiler DSO was loaded
async-profiler log:
(empty)
JVM attach socket is missing and jattach could not create it. It has most likely been removed; the process has to be restarted for a new socket to be created.

@Jongy Jongy added the enhancement New feature or request label Apr 29, 2022
@Jongy Jongy requested a review from adi-benz April 29, 2022 18:49
adi-benz
adi-benz previously approved these changes May 1, 2022
Base automatically changed from jattach-nicer-errors to master May 1, 2022 10:20
@Jongy
Copy link
Contributor Author

Jongy commented May 1, 2022

Rebased, no diff

@Jongy
Copy link
Contributor Author

Jongy commented May 1, 2022

$ git range-diff 9585329^..7a6fd66 master..jattach-socket-missing | cat
1:  9585329 = 1:  f237d66 java: Raise JattachSocketMissing if the attach socket is missing (HS only for now)
2:  fda5b0d = 2:  a7821fd Add comment
3:  7a6fd66 = 3:  b82a69c Rename exception and add a test

@Jongy Jongy requested a review from adi-benz May 1, 2022 10:28
@Jongy Jongy merged commit eeef667 into master May 1, 2022
@Jongy Jongy deleted the jattach-socket-missing branch May 1, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants