-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
0 results due to server error #7487
Conversation
@nabobalis , have drafted a tentative pr showing what changes i mean to do . The responses are too plain and generic , we can refine this , while also trying to not miss out on some edge cases . Currently Ive submitted the code for |
I am not sure that returning a string makes much sense, how does that interact with a unifiedresposne? |
|
||
return UnifiedResponse(*results) | ||
results = UnifiedResponse(*results) | ||
if results._numfile == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would len(results) also work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope , len (results) can be 1 , 0 or 2 depending on the client queried . I found it out yesterday while testing it for different clients
How does this look to a user? Do you have examples of a user query and the return/output when you hit this code? |
I think it has to work with a unifiedresponse. I would still first replicate a server error and then work out how what happens to a query. |
Well a warning attribute might not be a bad idea, we have something similar with the fetch return as But this should only be for an error/warning. IF there are no results, an empty response seems to make the most sense to me.
I don't have anything to mind. |
Yes , an empty response along with warning right ? (because the original issue mentioned to raise a warning in case of 0 matched results) |
I personally don't see the need for a warning if the server was fine but there are no results |
So this simplifies it , i'll raise a warning only if server gives error. right now i've kept max re-enqueueing limit as 5 . So we can make a warning attribute in unifiedResponse. what should the warning look like ? |
What about for the other clients that don't use the scraper? |
As of now , I was testing it using scraper dependent clients , for others clients I believe there wont be much change . (like the overall procedure could be the same . |
Sorry for the long break @nabobalis . I think , for those clients that dont use the generic client , we can implement the same logic similarly in the baseclient . Although , can I ask why few clients are based on genericclient , while others on base client ? |
Can we?
Some clients have to create their own search API. |
I guess what I am trying to get at is that I think you need to take a step back and work out how errors propagate through the clients currently. See if they do, how they do so, then work to see how you can extend that. Returning a string is not something that can or should be done in this case. You will need to work out the path for errors first. Hopefully that helps. |
Let me start from the basics .
for example CDAWEB uses As for the warning string , like I mentioned earlier , we can add a warning attribute to the unifiedResponse object to show the warning message for 0 results due to server error . |
But what errors need propagating from the scraper and how will that be done?
How do these clients handle errors? Are they raised? Do they break the search command?
Adding a ".errors" to the return from search mirrors how we do it for results and I think I am in favour of it on the surface. But it needs to be more than just a string. If you check the errors returned by Fido.fetch for example. |
after
Like I mentioned , Ill have to thoroughly test out the non generic clients . Right now , I can use generic clients to design the changes in the unifiedresponse object and observe the behaviour in different scenarios.
Do you suggest anything particularly ? Like making a new error type for 0 response server error ? . Is it really required . Moreover aren't we just returning a waning to the user instead of throwing an error . shouldn't error |
Is that the only error?
Until we know how they handle errors (and we should document this in the developer docs for Fido), I don't think we continue forward.
There are several things in play.
These are the questions we have to answer before we can start to code a solution. |
the http_err object is the standard interface , which can throw all the other http errors . So yes , I think that is the only error being thrown by the scraper currently.
This is a collective decision , whether we should raise an error or raise a warning.
What should it do except for raising error/warning ? . The best we can do is print a detailed error log regarding which server went down with other specifics . |
And this covers what http errors?
What does it do currently?
Yeah this probably needs more questions to be answered with some design work before we under take this. |
currently just 404 and 429
I am not sure , but if i am not wrong , it doesnt throw any error / warning (except for the pre query errors like date-range validation). It just returns empty response to the user . |
Ok, are those all the one we need to worry about?
Without knowing, we can't progress on this. It might be better to try another issue. Sorry about this. |
Nope , I think the scraper can be more robust , like handling different types of errors like 504 , and 404 (which is currently being ignored) and handling several edge cases. Can I raise a feature request to make the scraper more robust and work on it ? . So that later on it supports all the changes that might be done in this issue. |
Sure. |
As things stand, I don't think this PR will be merged in. For now the original issue was with the scraper, so we should seperate them in any follow up PRs. Thanks for your understanding. |
PR Description
Solving (#5661 )
This PR tries to resolve the ambiguity caused by 0 results caused by
no matching response from server
vsserver error
resulting in no response. The main motive is to return the error code from the scraper to get the context that there has been a server error which is difficult to reproduce it manually.