bruceadams / wdscli

Command line interface to the IBM Watson Discovery Service API
MIT License
8 stars 0 forks source link

Occasional hang in `add-document` #12

Closed bruceadams closed 7 years ago

bruceadams commented 7 years ago

The hang isn't common. My theory is the hang comes from one of the worker threads dying (with a panic) and the termination code of add-document demands that each thread absorb a shutdown message. So, the main thread waits forever.

colindean commented 7 years ago

@bruceadams If you don’t figure this out this weekend, I’d like to pair with you to fix this this coming week.

bruceadams commented 7 years ago

@colindean sounds great! I just implemented a timeout during shutdown, so at least it doesn't hang forever, but that's just a workaround, not a real solution.

bruceadams commented 7 years ago

I figured out what I was doing wrong when I was attempting to gather the JoinHandles into a collection. I was doing a map but did not have a collect() at the end! Oops 😊

colindean commented 7 years ago

👍