You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Several issues with TES/input URI processing in distance-based task distribution logic #134
When working with FTP in Funnel, we need to supply FTP credentials through the URLs. In the current implementation, input and TES URIs/URLs are parsed with urllib.parse.urlparse. Out of the resulting fragments, the netloc is then passed to socket.gethostbyname to get the IP of that host. However, the netloc extracted via urllib.parse.urlparse retains (basic) authorization credentials (e.g., user:[email protected]), but socket.gethostbyname is not able to parse these and throws a socket.gaierror. This exception is caught, but is handled in such a way that the list of input URIs is either incomplete or empty. In the latter case, this leads to an error in pro_tes.middleware.task_distribution.distance.task_distribution because no TES/input URL/URI combinations can be compiled (a situtation that is not handled).
To address this issue fully, the following should be done:
Remove auth credentials from URLs/URIs before determining IPs
Return a custom error amounting to 400 if input URIs cannot be parsed gethostbyname
Return a custom error amounting to 500 if TES URIs cannot be parsed by gethostbyname
Add comprehensive type hints to module
The distance-based logic should not fail if, for some reason, no TES/input IP combinations can be constructed; in that case, proTES should fall back to random distribution
Write unit tests for all code in the module and run in the CI
Activity