java - Amazon S3 upload InputStream - thread hangs -
i writing basic method put/get files amazon s3 bucket. here relevant code method."key" isthe s3 name , "savestream" inputstream
upload myupload = transfermanager.upload(daqbucketname, key, savestream, metadata); try { myupload.waitforcompletion(); savestream.close(); } catch (interruptedexception e) { key = null; e.printstacktrace(); } catch (amazonserviceexception e) { key = null; e.printstacktrace(); } catch (amazonclientexception e) { key = null; e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } { if (savestream != null) { try { savestream.close(); } catch (ioexception e) { e.printstacktrace(); } } } return key; }
the stream uploads there thread stops program completing (leaving program running). ideas going wrong ?here jstack dump:
"attach listener" daemon prio=10 tid=0x6a403c00 nid=0x2019 runnable [0x00000000] java.lang.thread.state: runnable "destroyjavavm" prio=10 tid=0xb6609400 nid=0x1b51 waiting on condition [0x00000000] java.lang.thread.state: runnable "s3-transfer-manager-worker-1" prio=10 tid=0x695d1800 nid=0x1b5f waiting on condition [0x68efe000] java.lang.thread.state: waiting (parking) @ sun.misc.unsafe.park(native method) - parking wait <0x9f3a2178> (a java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobject) @ java.util.concurrent.locks.locksupport.park(locksupport.java:186) @ java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobject.await(abstractqueuedsynchronizer.java:2043) @ java.util.concurrent.linkedblockingqueue.take(linkedblockingqueue.java:386) @ java.util.concurrent.threadpoolexecutor.gettask(threadpoolexecutor.java:1043) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1103) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:603) @ java.lang.thread.run(thread.java:679) "java-sdk-http-connection-reaper" daemon prio=10 tid=0x69551800 nid=0x1b5e waiting on condition [0x69292000] java.lang.thread.state: timed_waiting (sleeping) @ java.lang.thread.sleep(native method) @ com.amazonaws.http.idleconnectionreaper.run(idleconnectionreaper.java:75) "low memory detector" daemon prio=10 tid=0xb66cb000 nid=0x1b5c runnable [0x00000000] java.lang.thread.state: runnable "c2 compilerthread1" daemon prio=10 tid=0xb66c9400 nid=0x1b5b waiting on condition [0x00000000] java.lang.thread.state: runnable "c2 compilerthread0" daemon prio=10 tid=0xb66c7400 nid=0x1b5a waiting on condition [0x00000000] java.lang.thread.state: runnable "signal dispatcher" daemon prio=10 tid=0xb66c6000 nid=0x1b59 runnable [0x00000000] java.lang.thread.state: runnable "finalizer" daemon prio=10 tid=0xb66b6400 nid=0x1b58 in object.wait() [0x6ae7d000] java.lang.thread.state: waiting (on object monitor) @ java.lang.object.wait(native method) - waiting on <0x9f2a02c0> (a java.lang.ref.referencequeue$lock) @ java.lang.ref.referencequeue.remove(referencequeue.java:133) - locked <0x9f2a02c0> (a java.lang.ref.referencequeue$lock) @ java.lang.ref.referencequeue.remove(referencequeue.java:149) @ java.lang.ref.finalizer$finalizerthread.run(finalizer.java:177) "reference handler" daemon prio=10 tid=0xb66b4c00 nid=0x1b57 in object.wait() [0x6a7eb000] java.lang.thread.state: waiting (on object monitor) @ java.lang.object.wait(native method) - waiting on <0x9f2a4038> (a java.lang.ref.reference$lock) @ java.lang.object.wait(object.java:502) @ java.lang.ref.reference$referencehandler.run(reference.java:133) - locked <0x9f2a4038> (a java.lang.ref.reference$lock) "vm thread" prio=10 tid=0xb66b1000 nid=0x1b56 runnable "gc task thread#0 (parallelgc)" prio=10 tid=0xb6610800 nid=0x1b52 runnable "gc task thread#1 (parallelgc)" prio=10 tid=0xb6611c00 nid=0x1b53 runnable "gc task thread#2 (parallelgc)" prio=10 tid=0xb6613400 nid=0x1b54 runnable "gc task thread#3 (parallelgc)" prio=10 tid=0xb6614c00 nid=0x1b55 runnable "vm periodic task thread" prio=10 tid=0xb66cd400 nid=0x1b5d waiting on condition jni global references: 1641
Comments
Post a Comment