When downloading a tiny file (e.g., 1 B) or many files in parallel, our client would stick into a deadlock probably because dataSocket.close() in Downloader.java, which is actually Socket.close() in Java, can't be completed and return. Other downloading tasks (threads) will wait forever. I tried to force the thread to wait for an extra 1 sec before closing the socket if it lasts less than 1 sec, but this solution doesn't work in parallel downloading and seems stupid.
When downloading a tiny file (e.g., 1 B) or many files in parallel, our client would stick into a deadlock probably because
dataSocket.close()inDownloader.java, which is actuallySocket.close()in Java, can't be completed and return. Other downloading tasks (threads) will wait forever. I tried to force the thread to wait for an extra 1 sec before closing the socket if it lasts less than 1 sec, but this solution doesn't work in parallel downloading and seems stupid.