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

Asyncio traceback when closing #185

Closed
ivanpauno opened this issue Feb 14, 2019 · 0 comments · Fixed by #198
Closed

Asyncio traceback when closing #185

ivanpauno opened this issue Feb 14, 2019 · 0 comments · Fixed by #198
Assignees
Labels
bug Something isn't working

Comments

@ivanpauno
Copy link
Member

ivanpauno commented Feb 14, 2019

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • from source
  • Version or commit hash:
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • N/A

Steps to reproduce issue

Example launch file with the issue:

import signal

from launch import LaunchDescription
from launch import LaunchService
from launch.actions import EmitEvent
from launch.actions import ExecuteProcess
from launch.actions import TimerAction
from launch.events.process import matches_action
from launch.events.process import SignalProcess
from launch.substitutions import FindExecutable


def run_ls():
    exec_action = ExecuteProcess(
        cmd=[FindExecutable(name='python3'), '-c', '"while(1): pass"'],
        shell=True)
    kill_timer = TimerAction(
            period=5.0,
            actions=[
                EmitEvent(
                    event=SignalProcess(
                        signal_number=signal.SIGTERM,
                        process_matcher=matches_action(exec_action)))
                ])
    ld = LaunchDescription([
        exec_action,
        kill_timer,
    ])
    ls = LaunchService(debug=True)
    ls.include_launch_description(ld)
    assert 0 == ls.run()


if __name__ == '__main__':
    run_ls()
    run_ls()

I ran it doing python3 SCRIPT_NAME

Expected behavior

End after the five seconds timeout without an exception.

Actual behavior

After ending, this error happens:

Exception ignored in: <bound method BaseSubprocessTransport.__del__ of <_UnixSubprocessTransport closed pid=3649 returncode=-15 stdin=<_UnixWritePipeTransport closing fd=7 open> stdout=<_UnixReadPipeTrans
port fd=8 open> stderr=<_UnixReadPipeTransport fd=10 open>>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 132, in __del__
    self.close()
  File "/usr/lib/python3.6/asyncio/base_subprocess.py", line 106, in close
    proto.pipe.close()
  File "/usr/lib/python3.6/asyncio/unix_events.py", line 624, in close
    self.write_eof()
  File "/usr/lib/python3.6/asyncio/unix_events.py", line 610, in write_eof
    self._loop.call_soon(self._call_connection_lost, None)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 580, in call_soon
    self._check_closed()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 366, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Additional information

This is strange, because all is working fine and an exception is being raised when closing from asyncio lib. I couldn't find a simpler repro. I had a similar problem when working with #178. I only could repro this error when using shell=True option in ExecuteProcess.

@mjcarroll mjcarroll added the bug Something isn't working label Mar 7, 2019
@hidmic hidmic added the in progress Actively being worked on (Kanban column) label Mar 11, 2019
@hidmic hidmic removed the in progress Actively being worked on (Kanban column) label Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants