-
Notifications
You must be signed in to change notification settings - Fork 150
simplify download server #307
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
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rphillips The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
0edcfa4 to
e003418
Compare
|
/cc @wking |
e003418 to
365ec36
Compare
|
/hold for review comments |
365ec36 to
1418c24
Compare
1418c24 to
4e21daa
Compare
|
/retest |
|
@rphillips please also clarify the what & why of the PR in the description. Thanks! |
| from SocketServer import ThreadingMixIn | ||
| import SimpleHTTPServer, os, re, signal, sys, tarfile, tempfile, zipfile | ||
| class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): |
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.
I added the bulk of this script in #177. As discussed there, it was largely a copy-paste from ci-operator. @smarterclayton added that code on 2018-06-25 in openshift/ci-operator#35. I'm not familiar enough with its source to know what it's all about, but he links to https://stackoverflow.com/questions/46210672/ below and that says:
No, I don't want a hack such as ThreadingMixIn that merely collects up the response and returns it as a unit.
So I expect he was aware of this approach and has consciously decided against it. But maybe there have been stdlib improvements in 2.7 since that SO post? I haven't hunted deeply enough to know.
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.
I don't understand the original motivation... The main thread accepts the client and uses a thread to handle the I/O of the client. There is not a streaming interface with the current code.
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.
I am hesitant to do a ton with this w/o test coverage.
We will have an e2e test coming soon with #306, probably, which will indirectly help ensure this component doesn't fall over.
4e21daa to
63bb075
Compare
|
/close I'm going to close this as I'm not sure we have a good reason for the change. Feel free to reopen if we want to pick up the conversation again! |
Instead of maintaining a custom threaded http server, this PR migrates the downloader to use Python's included threaded http server.
This PR also captures sigterm, which was already merged into master.