storj / uplink-c

Uplink C library
MIT License
25 stars 8 forks source link

`dial_timeout_milliseconds` behavior difference between v1.7.0 and v1.8.0 #27

Closed s101d1 closed 1 year ago

s101d1 commented 1 year ago

I found out there is a behavior difference between uplink-c v1.7.0 and v1.8.0 regarding the dial_timeout_milliseconds in UplinkConfig.

In v1.7.0, if I run uplink_config_open_project function with dial_timeout_milliseconds set to 1 millisecond, any subsequent uplink operations, like uplink_ensure_bucket for example, will fail immediately due to the 1 millisecond timeout, but with uplink-c v1.8.0, now it doesn't fail anymore.

So I'm wondering is this a bug or is there a new meaning or purpose on the UplinkConfig.dial_timeout_milliseconds field?

egonelbre commented 1 year ago

Yes, that might be a bug. It'll need some investigation.

The dial_timeout_milliseconds should only apply to dialing and not any subsequent operations. So, 1ms could be sufficient time to successfully dial; or short enough to not trip specific checks. This wouldn't be a bug and there could've been a direct or accidental fix for it.

Alternatively, it could be that the timeout is ignored due to some missing value. This would be a bug.

egonelbre commented 1 year ago

Ah, @mniewrzal remembered that https://github.com/storj/uplink/blob/main/config.go#L35 was deprecated, because for some connection mechanisms it doesn't make sense any more. The uplink-c library documentation needs some updating.

s101d1 commented 1 year ago

Thank you for the clarification.