u-root / iscsinl

Go iSCSI initiator netlink library
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

iscsinl: introduce ScanTimeout #9

Closed hugelgupf closed 4 years ago

hugelgupf commented 4 years ago

The old loop would run for exactly 300ms, and then use the uevents generated during that time. 300ms might not be long enough if it's on a physical network link (our tests are VM only). However, we also need to still support more than 1 LUN.

I'm not sure how to find out how many LUNs there are going to be beforehand, so we don't know how many devices we are looking for.

So for now, we do the following: we keep looping to find matches, until we're reasonably sure that no new ones are coming. We time out after 3 seconds, which any caller can change.