Skip to content

usbhid-ups attempts to reconnect are a suicide mission (Windows builds at least) #1627

@jimklimov

Description

@jimklimov

Recovery from I/O error goes wrong:

   1.653775     Using subdriver: MGE HID 1.46
...
   6.805866     [D1] upsdrv_updateinfo...
   6.807082     [D1] Got to reconnect!
   6.808156
Reconnecting. If you saw "nut_libusb_get_interrupt: Input/Output Error" or similar message in the log above, try setting "pollonly" flag in "ups.conf" options section for this driver!

   6.815235     [D4] Closing comm_driver previous handle
   6.817622     [D4] ===================================================================
   6.820101     [D4]  device has been disconnected, try to reconnect
   6.821994     [D4] ===================================================================
   6.825334     [D4] Opening comm_driver ...

Code in question (in reconnect_ups()):

	upsdebugx(4, "Opening comm_driver ...");
	ret = comm_driver->open_dev(&udev, &curDevice, subdriver_matcher, NULL);
	upsdebugx(4, "Opening comm_driver returns ret=%i", ret);

so it never passes open_dev alive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions