Help! How to kill a hung cart order?

14 views
Skip to first unread message

King Lung Chiu

unread,
Jan 7, 2014, 1:02:00 AM1/7/14
to medi...@googlegroups.com
"shopping.cart.processing.abort :sid $cartID" is not working for me (see below).

Note my access for 'can-modify' is false even though I'm logged in as system:manager (and created and ordered the cart as system:manager on aterm too).

I need to kill this one as all my subsequent cart orders seem to be on hold (status = "processing") waiting for this one to finish, and it's preventing me from testing my custom sink ... :-(

Any ideas?

Thanks a lot,

King

===
> shopping.cart.processing.abort :sid 182
> shopping.cart.describe :sid 182
    :cart -id "182"
        :status -changed "07-Jan-2014 15:41:41" "processing"
        :log -status "processing" -changed "07-Jan-2014 15:41:41" "Cart is now in processing"
        :log -status "assigned" -changed "07-Jan-2014 15:41:41" "Cart has now been assigned to user system:manager"
        :log -status "editable" -changed "07-Jan-2014 15:41:41" "Contents can be added to the cart"
        :decompress-archive "true"
        :template "pssd"
        :order "182"
        :owner -type "user" "system:manager"
        :access
            :can-modify "false"
            :can-re-edit "false"
            :can-withdraw "false"
            :can-reprocess "false"
            :can-destroy "false"
        :assigned-to "system:manager"
        :self-serviced "true"
        :content-statistics
            :item-count "1"
            :item-size -units "bytes" "550582"
            :content-mimetype
                :name -count "1" "dicom/series"
        :data-transformation
            :transcode
                :from "dicom/series"
                :to "none"
        :delivery-method "DEPOSIT"
            :delivery-destination "sink:scpTest"
            :delivery-arg -name "privateKey"  (... cut)
            :delivery-arg -name "username" "root"
        :available-packaging-methods
            :name "none"
            :name "aar"
            :name "jar"
            :name "compressed-tar"
            :name "tar"
            :name "zip"
            :name "iso9660"
        :packaging "none"
        :layout "custom"
            :layout-pattern "cid(-7,-5)/cid(-7,-4)/cid(-7,-3)/cid(-7,-2)/replace(if-null(variable(tx-to-type), xpath(asset/type)),'/','_')/cid(-1)if-null(xpath(pssd-object/name),'','_')xpath(pssd-object/name)"
>
> shopping.cart.list :status processing
    :cart -id "182" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "183" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "184" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "185" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "186" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "187" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "188" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "189" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "190" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "191" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "192" -template "pssd" -status "processing" -self-serviced "true"
    :cart -id "193" -template "pssd" -status "processing" -self-serviced "true"
    :cursor
        :from "1"
        :to "12"
===




King Lung Chiu

unread,
Jan 7, 2014, 1:14:03 AM1/7/14
to medi...@googlegroups.com
further info:

> shopping.cart.withdraw :sid 182
error: executing shopping.cart.withdraw: [arc.mf.server.Services$ExServiceError]: call to service 'shopping.cart.withdraw' failed: Cart  182 is in state PROCESSING: cannot withdraw
> shopping.cart.processing.abort :sid 182
> shopping.cart.destroy :sid 182
error: executing shopping.cart.destroy: [arc.mf.server.Services$ExServiceError]: call to service 'shopping.cart.destroy' failed: Cart  182 is in state PROCESSING: cannot destroy

Jason Lohrey

unread,
Jan 7, 2014, 7:03:44 PM1/7/14
to King Lung Chiu, medi...@googlegroups.com
What is the stack trace of the process that is ordering?

You can ascertain that by executing: server.threads.get, and identifying the order processing thread — if you cannot identify that thread, just send the entire output of server.threads.get.

I’ve updated the service description for “shopping.cart.withdraw” which can be used only if the cart is not yet processing.

You do need to use “shopping.cart.processing.abort”. The reason I want to see what the stack trace is doing — it that the thread will only be aborted if it checks to see whether aborted. The order processing will do that after processing each asset. If the thread is blocked, then it will not be aborted — Java does not provide a means to reliably abort a running thread.

However, you may have a thread in the processing state, which is not actually running — I’d need to see the stack trace to determine what state it’s in in order to figure out the best way to handle recalcitrant processing.

Jason



--
You received this message because you are subscribed to the Google Groups "mediaflux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediaflux+...@googlegroups.com.
To post to this group, send email to medi...@googlegroups.com.
Visit this group at http://groups.google.com/group/mediaflux.
For more options, visit https://groups.google.com/groups/opt_out.

JASON LOHREY
Chief Technical Officer


King Lung Chiu

unread,
Jan 7, 2014, 8:09:44 PM1/7/14
to Jason Lohrey, medi...@googlegroups.com
Thanks Jason. Here's the output. I've included the whole thing in case there are other relevant threads. My specific code is the one with "nig.mf.plugin.sink.SCPSink.writeFile(SCPSink.java:260)". I'll dig into that more myself.

Thanks again!

King



> server.threads.count
    :count "38"
> server.threads.get
    :dump "======== Thread Stack Trace Dump ============

08-Jan-2014 12:02:41

Server Version: 3.8.052

---------- Thread --------
Thread[id=24, name="TimerQueue", priority=5, group="system"]

at sun.misc.Unsafe.park(native code)
at java.util.concurrent.locks.LockSupport.park(unknown file)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(unknown file)
at java.util.concurrent.DelayQueue.take(unknown file)
at javax.swing.TimerQueue.run(unknown file)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=42, name="Archive Reader", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.ae.run(SourceFile:30)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=11, name="AWT-Windows", priority=6, group="main"]

at sun.awt.windows.WToolkit.eventLoop(native code)
at sun.awt.windows.WToolkit.run(unknown file)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=44, name="Archive Transform", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.au.a(SourceFile:41)
at arc.au.run(SourceFile:74)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=10, name="AWT-Shutdown", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at sun.awt.AWTAutoShutdown.run(unknown file)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=3, name="Finalizer", priority=8, group="system"]

at java.lang.Object.wait(native code)
at java.lang.ref.ReferenceQueue.remove(unknown file)
at java.lang.ref.ReferenceQueue.remove(unknown file)
at java.lang.ref.Finalizer$FinalizerThread.run(unknown file)

---------- Thread --------
Thread[id=33, name="15: Network Service: http (port=451)", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.net.DualStackPlainSocketImpl.accept0(native code)
at java.net.DualStackPlainSocketImpl.socketAccept(unknown file)
at java.net.AbstractPlainSocketImpl.accept(unknown file)
at java.net.PlainSocketImpl.accept(unknown file)
at java.net.ServerSocket.implAccept(unknown file)
at sun.security.ssl.SSLServerSocketImpl.accept(unknown file)
at arc.mf.network.NetworkService.c(SourceFile:941)
at arc.mf.network.NetworkService.a(SourceFile:36)
at arc.azc.doExecute(SourceFile:56)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=43, name="Archive Transform", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.au.a(SourceFile:41)
at arc.au.run(SourceFile:74)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=2, name="Reference Handler", priority=10, group="system"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(unknown file)

---------- Thread --------
Thread[id=16, name="Timer-0", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.util.TimerThread.mainLoop(unknown file)
at java.util.TimerThread.run(unknown file)

---------- Thread --------
Thread[id=36, name="Work List 1", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aPp.a(SourceFile:105)
at arc.aPq.doExecute(SourceFile:82)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=31, name="Asset Access Time: Writer", priority=5, group="main"]

at java.lang.Object.wait(native code)
at arc.ON.c(SourceFile:143)
at arc.ON.a(SourceFile:9)
at arc.OO.run(SourceFile:39)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=29, name="Thread-11", priority=5, group="main"]

at java.lang.Thread.sleep(native code)
at arc.amx.e(SourceFile:351)
at arc.amx.d(SourceFile:33)
at arc.amG.run(SourceFile:337)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=18, name="I/O Job - GC", priority=5, group="main"]

at java.lang.Thread.sleep(native code)
at arc.ok.f(SourceFile:171)
at arc.ok.e(SourceFile:23)
at arc.ol.run(SourceFile:46)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=27, name="6: automation:EventHorizonTask", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Thread.sleep(native code)
at arc.ZM.a(SourceFile:74)
at arc.ZM.a(SourceFile:54)
at arc.aIq.a(SourceFile:11)
at arc.ZL.doExecute(SourceFile:54)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=4, name="Signal Dispatcher", priority=9, group="system"]


---------- Thread --------
Thread[id=21, name="XODB Buffer I/O", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aVM.a(SourceFile:65)
at arc.aVM.d(SourceFile:87)
at arc.aVM.a(SourceFile:11)
at arc.aVN.run(SourceFile:116)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=34, name="16: schedule:timer", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Thread.sleep(native code)
at arc.asd.doExecute(SourceFile:48)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=26, name="File Policy: GC", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at arc.Vc.run(SourceFile:46)
at arc.mf.plugin.PluginThread$PluginTask.doExecute(SourceFile:200)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.mf.server.Server.a(SourceFile:1763)
at arc.aAs.doExecute(SourceFile:1706)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=45, name="Archive Transform", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.au.a(SourceFile:41)
at arc.au.run(SourceFile:74)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=20, name="DestroyJavaVM", priority=5, group="main"]


---------- Thread --------
Thread[id=48, name="32: Network Connection: http [port=451]", priority=5, group="main"]

---- Execution Context ----
            0.002 sec(s) ago: service: system:manager [sid=18]: server.threads.get 
  called by: 0.003 sec(s) ago: http: /__mflux_svc__/ 
--------------------------

at java.lang.Thread.dumpThreads(native code)
at java.lang.Thread.getAllStackTraces(unknown file)
at arc.aPg.a(SourceFile:70)
at arc.aFO.a(SourceFile:37)
at arc.mf.server.Services.a(SourceFile:1473)
at arc.mf.server.Services.a(SourceFile:1420)
at arc.mf.server.Services.a(SourceFile:1336)
at arc.mf.server.Services.c(SourceFile:1018)
at arc.mf.server.Services.b(SourceFile:699)
at arc.mf.server.Services.a(SourceFile:684)
at arc.alf.a(SourceFile:197)
at arc.ajH.a(SourceFile:199)
at arc.ajJ.a(SourceFile:633)
at arc.ajJ.a(SourceFile:409)
at arc.ajJ.a(SourceFile:286)
at arc.anl.a(SourceFile:49)
at arc.aza.run(SourceFile:190)
at arc.azb.doExecute(SourceFile:335)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=38, name="Work List 3", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.io.InputStream.read(unknown file)
at nig.mf.plugin.sink.SCPSink.writeFile(SCPSink.java:260)
at nig.mf.plugin.sink.SCPSink.consume(SCPSink.java:162)
at arc.avZ.a(SourceFile:131)
at arc.avV.a(SourceFile:170)
at arc.avW.a(SourceFile:374)
at arc.aum.a(SourceFile:47)
at arc.auF.a(SourceFile:370)
at arc.auF.a(SourceFile:242)
at arc.auF.a(SourceFile:34)
at arc.auG.a(SourceFile:169)
at arc.auG.a(SourceFile:162)
at arc.aIq.a(SourceFile:11)
at arc.auF.doExecute(SourceFile:162)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPq.doExecute(SourceFile:84)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=37, name="Work List 2", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aPp.a(SourceFile:105)
at arc.aPq.doExecute(SourceFile:82)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=5, name="Attach Listener", priority=5, group="system"]


---------- Thread --------
Thread[id=9, name="Java2D Disposer", priority=10, group="system"]

at java.lang.Object.wait(native code)
at java.lang.ref.ReferenceQueue.remove(unknown file)
at java.lang.ref.ReferenceQueue.remove(unknown file)
at sun.java2d.Disposer.run(unknown file)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=22, name="XODB: Async commit", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aTp.d(SourceFile:34)
at arc.aTp.run(SourceFile:48)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=30, name="Order Processing Thread", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.auF.waitToComplete(SourceFile:122)
at arc.auB.a(SourceFile:152)
at arc.auB.a(SourceFile:179)
at arc.auB.b(SourceFile:209)
at arc.auB.a(SourceFile:33)
at arc.auD.a(SourceFile:189)
at arc.auD.a(SourceFile:186)
at arc.aIq.a(SourceFile:11)
at arc.auB.run(SourceFile:186)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=19, name="Pooled", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aPd.a(SourceFile:470)
at arc.aPd.run(SourceFile:442)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=23, name="2: Peer Monitor", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at arc.aBT.a(SourceFile:73)
at arc.aBT.a(SourceFile:57)
at arc.aIq.a(SourceFile:11)
at arc.aBS.c(SourceFile:57)
at arc.aBS.b(SourceFile:17)
at arc.aBU.doExecute(SourceFile:38)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=35, name="Work List 0", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aPp.a(SourceFile:105)
at arc.aPq.doExecute(SourceFile:82)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=14, name="AWT-EventQueue-0", priority=6, group="main"]

at sun.misc.Unsafe.park(native code)
at java.util.concurrent.locks.LockSupport.park(unknown file)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(unknown file)
at java.awt.EventQueue.getNextEvent(unknown file)
at java.awt.EventDispatchThread.pumpOneEventForFilters(unknown file)
at java.awt.EventDispatchThread.pumpEventsForFilter(unknown file)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(unknown file)
at java.awt.EventDispatchThread.pumpEvents(unknown file)
at java.awt.EventDispatchThread.pumpEvents(unknown file)
at java.awt.EventDispatchThread.run(unknown file)

---------- Thread --------
Thread[id=46, name="Archive Transform", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.au.a(SourceFile:41)
at arc.au.run(SourceFile:74)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=39, name="Schedule:Event:Monitor", priority=5, group="main"]

at java.lang.Thread.sleep(native code)
at arc.asq.c(SourceFile:51)
at arc.asq.b(SourceFile:10)
at arc.asr.run(SourceFile:36)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=17, name="DataCache - GarbageCollector", priority=5, group="main"]

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aJ.a(SourceFile:30)
at arc.aJ.run(SourceFile:44)
at java.lang.Thread.run(unknown file)

---------- Thread --------
Thread[id=47, name="Pooled", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.aPd.a(SourceFile:470)
at arc.aPd.run(SourceFile:442)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=28, name="7: automation:EventExecutionTask", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.lang.Object.wait(native code)
at java.lang.Object.wait(Object.java:503)
at arc.ZN.a(SourceFile:85)
at arc.ZK.doExecute(SourceFile:33)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)

---------- Thread --------
Thread[id=32, name="14: Network Service: http (port=8090)", priority=5, group="main"]

---- Execution Context ----

--------------------------

at java.net.DualStackPlainSocketImpl.accept0(native code)
at java.net.DualStackPlainSocketImpl.socketAccept(unknown file)
at java.net.AbstractPlainSocketImpl.accept(unknown file)
at java.net.PlainSocketImpl.accept(unknown file)
at java.net.ServerSocket.implAccept(unknown file)
at java.net.ServerSocket.accept(unknown file)
at arc.mf.network.NetworkService.c(SourceFile:941)
at arc.mf.network.NetworkService.a(SourceFile:36)
at arc.azc.doExecute(SourceFile:56)
at arc.utils.Task.c(SourceFile:494)
at arc.utils.Task.run(SourceFile:465)
at arc.aPd.b(SourceFile:492)
at arc.aPd.run(SourceFile:452)
at arc.aPc.run(SourceFile:302)



==============================================
Summary:

  Running:  10
  Waiting:  23
  Sleeping: 5

=============================================="
Arcitecta.png

Jason Lohrey

unread,
Jan 7, 2014, 8:13:36 PM1/7/14
to King Lung Chiu, medi...@googlegroups.com
Right, if your code is there, it is not abortable — it needs to exit before aborting.


<Arcitecta.png>



JASON LOHREY
Chief Technical Officer


ARCITECTA
5/26-36 High Street, Northcote
Victoria, Australia 3070
http://www.arcitecta.com
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email or messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Arcitecta shall be understood as neither given nor endorsed by it.

King Lung Chiu

unread,
Jan 7, 2014, 8:28:07 PM1/7/14
to Jason Lohrey, medi...@googlegroups.com
On 8 January 2014 12:13, Jason Lohrey <jason....@arcitecta.com> wrote:
Right, if your code is there, it is not abortable — it needs to exit before aborting.

OK. Say the code is hung on that particular line so the order won't complete:

1) Is there a way to delete the hung order if I terminate MF? I do notice the CPU usage drops once it's terminated ... so that thread is probably stuck in some infinite loop ...

2) Are all subsequent orders put on hold (eg. in a queue) until that one finishes?

3) And if so, is there a way to clear at least those pending orders?

eg. the last order I placed is a deposit to a file system sink, and it's not executing either and I don't seem to be able to abort it:


> shopping.cart.describe :sid 193
    :cart -id "193"
        :status -changed "07-Jan-2014 16:25:45" "processing"
        :log -status "processing" -changed "07-Jan-2014 16:25:45" "Cart is now in processing"
        :log -status "assigned" -changed "07-Jan-2014 16:25:45" "Cart has now been assigned to user system:manager"
        :log -status "editable" -changed "07-Jan-2014 16:25:44" "Contents can be added to the cart"
        :decompress-archive "true"
        :template "pssd"
        :order "193"
        :owner -type "user" "system:manager"
        :access
            :can-modify "false"
            :can-re-edit "false"
            :can-withdraw "false"
            :can-reprocess "false"
            :can-destroy "false"
        :assigned-to "system:manager"
        :self-serviced "true"
        :content-statistics
            :item-count "1"
            :item-size -units "bytes" "550582"
            :content-mimetype
                :name -count "1" "dicom/series"
        :data-transformation
            :transcode
                :from "dicom/series"
                :to "none"
        :delivery-method "DEPOSIT"
            :delivery-destination "sink:sink003"
        :available-packaging-methods
            :name "none"
            :name "aar"
            :name "jar"
            :name "compressed-tar"
            :name "tar"
            :name "zip"
            :name "iso9660"
        :packaging "none"
        :layout "custom"
            :layout-pattern "cid(-7,-5)/cid(-7,-4)/cid(-7,-3)/cid(-7,-2)/replace(if-null(variable(tx-to-type), xpath(asset/type)),'/','_')/cid(-1)if-null(xpath(pssd-object/name),'','_')xpath(pssd-object/name)"
> shopping.cart.processing.abort :sid 193
Arcitecta.png

King Lung Chiu

unread,
Jan 7, 2014, 8:42:38 PM1/7/14
to Jason Lohrey, medi...@googlegroups.com
And I've dug through my code a bit more ... my lines have shifted as I've made some undoable changes, but looking at the stack dump 
notice it's actually stuck on InputStream.read(unknown file), and my code looks like this:

      SCPOutputStream os = scp.put(name, lisSize, dir, "0600");
      try {
         // lis = LongInputStream supplied via consume(...)
         while(lis.hasData()) {
            int size = lis.read(buff);
            if(size > 0)
               os.write(buff, 0, size);
         }
      } finally {
         os.close();         
      }

ie. it seems to be stuck waiting for data from the input stream ...

The read(...) function inherits the Javadocs from java.io.InputStream:

       "Reads some number of bytes from the input stream and stores them into the buffer array b. The number of bytes actually read is returned as an integer. This method blocks until input data is available, end of file is detected, or an exception is thrown ..."

So does LongInputStream adhere to the above? Or are there circumstances where a read(...) may block - and perhaps lis.hasData() returns true - even though there are no more data left?

And just a thought: is there a way to externally trigger an exception on that read() so it unblocks (and hopefully the thread then terminates, albeit with an error, allowing other orders to proceed)?


Thanks again,

King





On 8 January 2014 12:13, Jason Lohrey <jason....@arcitecta.com> wrote:
Arcitecta.png

Jason Lohrey

unread,
Jan 7, 2014, 9:09:53 PM1/7/14
to King Lung Chiu, medi...@googlegroups.com
Your loop is wrong - you are in an infinite loop.

You should be checking for -1 (EOF/EOS) and breaking.

The method hasData is a little misleading — it’s not meant to be a substitute for length or remaining — but was rather intended to be mightHaveData, generally used for initial check.

Either a) get the length up front and loop to that length, or b) if the length is unknown loop until the length is -1.

We have a nice utility class that does all this work: StreamCopy.

You can simply: 

StreamCopy.copy(lis,os);

Jason



<Arcitecta.png>

ARCITECTA
5/26-36 High Street, Northcote
Victoria, Australia 3070
http://www.arcitecta.com
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to email or messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Arcitecta shall be understood as neither given nor endorsed by it.

--
You received this message because you are subscribed to the Google Groups "mediaflux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediaflux+...@googlegroups.com.
To post to this group, send email to medi...@googlegroups.com.
Visit this group at http://groups.google.com/group/mediaflux.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "mediaflux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mediaflux+...@googlegroups.com.
To post to this group, send email to medi...@googlegroups.com.
Visit this group at http://groups.google.com/group/mediaflux.
For more options, visit https://groups.google.com/groups/opt_out.
JASON LOHREY
Chief Technical Officer

King Lung Chiu

unread,
Jan 7, 2014, 9:19:14 PM1/7/14
to Jason Lohrey, medi...@googlegroups.com
We have a nice utility class that does all this work: StreamCopy.
You can simply: 
StreamCopy.copy(lis,os);

Nice, I'll use this instead.

Would it be useful / necessary if I do lis.close() at the end too? Currently only doing os.close().

ta,

King
Arcitecta.png

King Lung Chiu

unread,
Jan 7, 2014, 9:34:49 PM1/7/14
to Jason Lohrey, medi...@googlegroups.com
OK, had a bit more look at StreamCopy: can I use IoPerformanceHints to specify recommended buffer size?

I'm allowing the user to specify the buffer size via sink parameters.

thanks again,

King


Arcitecta.png

Jason Lohrey

unread,
Jan 7, 2014, 10:03:41 PM1/7/14
to King Lung Chiu, medi...@googlegroups.com
Yes, you can use IoPerformanceHints. 

Generally though, the system will choose the largest available buffer size from the pool based on the amount of data in the incoming stream.

Is there any reason to allow a smaller size — is there some optimal size for SSH?

You don’t need to close the input stream — that will be done automatically.

Jason

King Lung Chiu

unread,
Jan 7, 2014, 10:26:26 PM1/7/14
to Jason Lohrey, medi...@googlegroups.com
On 8 January 2014 14:03, Jason Lohrey <jason....@arcitecta.com> wrote:
Yes, you can use IoPerformanceHints. 

Generally though, the system will choose the largest available buffer size from the pool based on the amount of data in the incoming stream.

Is there any reason to allow a smaller size — is there some optimal size for SSH?

Not specifically.

It's mainly based around the conversation we had a couple months ago about MF potentially parallelising the writes (or having concurrent orders running), in which case too many overly large buffers may exceed the available RAM and actually slow things down.

But I'm happy to leave the decision to StreamCopy if it's somehow handled internally ... one less thing to think about :-)

cheers,

King
Arcitecta.png
Reply all
Reply to author
Forward
0 new messages