Skip to content

wait_for is Holding Up SIGINT #22

@iguessthislldo

Description

@iguessthislldo

While reviewing #20 where a wait_for currently times out after a minute, I noticed that hitting control-c didn't do anything. Well it did work eventually after the timeout happened.

Waiting for Subscriber...
^C^C^C^C^C^C^C^C^C^C^C^CTraceback (most recent call last):
  File "publisher.py", line 20, in <module>
    writer.wait_for(StatusKind.PUBLICATION_MATCHED, timedelta(seconds=60))
  File ".../pyopendds/pyopendds/DataWriter.py", line 26, in wait_for
    return datareader_wait_for(self, status, *normalize_time_duration(timeout))
  File ".../pyopendds/pyopendds/exceptions.py", line 34, in check
    @classmethod
KeyboardInterrupt

I'd have to research this more, but it looks like what ever signal handler CPython has doesn't interrupt native extension code. This makes sense because it has to handle it by making a KeyboardInterrupt in Python, but is annoying since it's different from how a C++ OpenDDS application would behave. The correct solution probably involves avoiding OpenDDS's implementation of wait_for and creating an implementation in Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions