Skip to content

shutdown refactor issues #11

@colinsurprenant

Description

@colinsurprenant

there are issues that need to be fixed related to the shutdown refactor.

  • a stop method should be implemented that force-closes the socket to make sure it will not ne stuck in IO somewhere regardless if we are using select... for safety.
  • I would change the current close method to
def close
  @udp.close rescue nil
end 

and add an identical stop method

def stop
  @udp.close rescue nil
end 

note that with a proper stop the current close method is useless, unless we move the UDPSocket creation in the register method as proposed in #10 where we could have a situation where the plugin register method is called but not the run & stop and then only close, like in specs in which case both close and stop are required.

plugin.stop should be rewritten as

plugin.do_stop
input_thread.join

otherwise the stop? method will never return true and there could be race conditions with the input thread.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions