-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back to non-threaded DNS requests if can't start async DNS thread? #6830
Comments
You built curl for asynchronous DNS which is either c-ares or threaded, and since there is no ares library listed in the libraries that means it is threaded. In other words, you built curl to use threaded dns. |
On all other systems that I'm aware of, the creation of a new thread won't just fail and we would be okay with it and instead try another method so this feels like a special need for this platform.
What would a better error message be like? It does fail to start the thread. |
This is not actually an "issue" or a "bug" in current curl. This is discussing a future potential improvement or enhancement of name resolving for a particular target. We're always for improvements, but we need someone to write the code and propose it as a pull-request so that can see what it means and eventually merge it. This particular change is very target-specific and will basically require that someone who runs and uses such a platform works out the implementation details to make sure they get done right. |
wrt Async enabled: yes, that's how it comes from the downstream, and it's desirable.... except for this corner case. wrt target specific: in retrospect, thread creation difficulty is pretty rare, so it effectively is a platform-specific problem despite being cross-platform in theory. The simplest/least intrusive way might be to append an additional message to that error message for platforms like this that suffer from threading confusion. Orr it might just simply fall on people like me who support these users to get them to actually... turn on the threading option. I definitely understand if upstream here isn't willing to take the additional effort here. |
It's us we're talking about, we are not upstream. We are here. Again: I would probably be okay with "taking the additional effort" if that could be seen as a way to make life easier for a certain number of users, but someone (else) would have to roll up their sleeves and provide the code because I won't. The code needs to be verified for both scenarios on relevant systems. |
Sorry there - was thinking way too much of downstreams and I'm a little loopy on holidays. And agreed on above. A patch that doesn't change behaviour, just explains the solution for affected users would be something like: diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index c453203f7..b9fe5dbb9 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -733,7 +733,11 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
return NULL;
}
- failf(data, "getaddrinfo() thread failed to start");
+ failf(data, "getaddrinfo() thread failed to start"
+#if defined(__OS400__) || defined(__PASE__) /* IBM i ILE, IBM i PASE */
+ " (on IBM i, you may need to set env var QIBM_MULTI_THREADED to Y)"
+#endif
+ );
return NULL;
} |
|
|
I think this problem should be fixed by documentation rather than putting such a platform specific message into the error message. The error message also won't help users, as it is rather an instruction to whoever built curl and I think its the wrong place for such an instruction. |
Thinking about it over the weekend, I agree. I assume minority platform-specific documentation should go in |
I think you need to help us suggest where to put it and what to say. The |
I did this
A lot of IBM i users are calling curl (not the native ILE version, but the Unix version under PASE, though the ILE native one will likely be affected since pthread is the same under both), be it standalone or via say, PHP, through programs/scripts in the native environment. The native environment has... quirky thread safety rules, so by default, programs invoked can't create threads. As such, curl will usually fail out with a message like
getaddrinfo() thread failed to start
.I expected the following
I end up telling people a lot to add the magic environment variable or such to make threading work. While this is ideal (you want async DNS to work if it can), it is pretty annoying; I wonder if a fallback is reasonable, or perhaps on i specifically, a better error message?
curl/libcurl version
operating system
IBM i PASE 7.2
The text was updated successfully, but these errors were encountered: