Is there a way to abort a processing thread

Straight forward question... How do I handle timeouts for server-side script execution in a web server?
Let's say I have a very simple server that only handles one request at a time... A request arrives for a webpage including a piece of some server-side script (that may contain an infinite loop). My server parses the request and starts executing the corresponding script in a new thread. Now, I could do join(timeout) on this thread and then call stop() if the script is still executing... the problem is that stop() is depricated and thus it feels like the wrong approach. But what are my alternatives?

>
Re: Is there a way to abort a processing threadNo, there isn't.
Straight forward question... How do I handle timeouts for server-side script execution in a web server?From the client end or on the server? If it's on the server see the first reply
Let's say I have a very simple server that only handles one request at a time... A request arrives for a webpage including a piece of some server-side script (that may contain an infinite loop).In general, this is a very very bad thing. You never want to expose functionality to a client that could put you into an infinite loop or kill your system somehow.
For more information, google for "SQL injection", see what that is and why it's very very evil
My server parses the request and starts executing the corresponding script in a new thread. Now, I could do join(timeout) on this thread and then call stop() if the script is still executing... the problem is that stop() is depricated and thus it feels like the wrong approach. But what are my alternatives?Stop() is not only deprecated, but it's not implemented / non-functional (at least on my machine).
The best alternative is not to run anything that you aren't confident at compile time will return in finite time.
Another alternative that I do not recommend is that there is a debug API... I forget the name - something used in IDEs to get the state of threads + mem, etc. Honestly, I don't think that even that will allow you terminate a thread, but you might want to look into it.

Similar Messages

  • I am having difficulty downloading attachments (i.e. pdfs, photos) from email. Is there a way to improve this process?

    I am having difficulty downloading attachments (i.e. pdfs, photos) from email. Is there any way to make this process faster? Thanks!

    In Firefox Options / Privacy be sure "Remember download history" is checked. To see all of the options on that panel, "Firefox will" must be set to "Use custom settings for history".
    To find your OS information, on your Windows desktop, right-click the My Computer icon, choose Properties, under System on that small window is info about your OS.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • HT4889 Is there a way to abort a transfer of data from an old MacBook Pro to a new one when you're using Wi-Fi?

    Is there a way to abort a transfer of data from an old MacBook to a new MacBook Pro when you're using Wi-Fi?

    If you are sure you want to to do it: command + option + esc, then and Force Quit.
    ethernet is much faster than wifi.

  • Is there a way to find which process s chain was scheduled?

    I am developing a query on 0TCT_C21. Is there a way to find which process chains were scheduled to run? I want to see only those process chains. 
    If 0TCT_C21 does not have the information, is it a way to get from somewhere else (i.e., some other tables using virtual characteristic or so  ...).
    Thanks a lot,

    You need to use a combination of tables and function modules.
    Table TBTCO contains list of jobs with job status 'S' for scheduled
    Table TBTCP contains the program name and variant scheduled in that job
    you need to use a function module to know the chain name using the above program name and variant.
    I have written a sample code to do this. feel free to change it as per your needs.
    REPORT  ztest4.
    TYPES: BEGIN OF l_s_scheduled,
           jobname  TYPE tbtco-jobname,
           jobcount TYPE tbtco-jobcount,
           sdlstrtdt TYPE tbtco-sdlstrtdt,
           sdlstrttm TYPE tbtco-sdlstrttm,
           progname TYPE tbtcp-progname,
           variant TYPE tbtcp-variant,
           chain   TYPE rspc_chain,
      END OF l_s_scheduled.
    DATA: l_t_scheduled TYPE STANDARD TABLE OF l_s_scheduled,
          l_t_valtab    TYPE STANDARD TABLE OF rsparams,
          l_w_valtab    TYPE rsparams.
    FIELD-SYMBOLS     <l_f_scheduled> TYPE l_s_scheduled.
    SELECT a~jobname a~jobcount a~sdlstrtdt a~sdlstrttm b~progname b~variant
    INTO CORRESPONDING FIELDS OF TABLE l_t_scheduled
       FROM tbtco AS a JOIN tbtcp AS b
                  ON a~jobname = b~jobname AND
                     a~jobcount = b~jobcount
    WHERE a~jobname = 'BI_PROCESS_TRIGGER' AND
          a~status = 'S'. "Scheduled
    LOOP AT l_t_scheduled ASSIGNING <l_f_scheduled>.
      REFRESH l_t_valtab.
      CALL FUNCTION 'RS_VARIANT_CONTENTS'
        EXPORTING
          report               = <l_f_scheduled>-progname
          variant              = <l_f_scheduled>-variant
        TABLES
          valutab              = l_t_valtab
        EXCEPTIONS
          variant_non_existent = 1
          variant_obsolete     = 2
          OTHERS               = 3.
      IF sy-subrc = 0.
        READ TABLE l_t_valtab INTO l_w_valtab
        WITH KEY selname = 'CHAIN'.
        IF sy-subrc = 0.
          <l_f_scheduled>-chain = l_w_valtab-low.
        ENDIF.
        WRITE :/ <l_f_scheduled>-chain, <l_f_scheduled>-sdlstrtdt, <l_f_scheduled>-sdlstrttm.
      ENDIF.
    ENDLOOP.
    The structure l_s_scheduled in the above program can be extended with more fields and can be used as extract structure in a generic datasource  of type function module and can be fed into a DSO for reporting.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/d-f/functional%20module%20based%20generic%20datasource%20part%20i.pdf
    Hope it helps!

  • I am building a website using IWEB, on my computer, and I am stuck suddenly, the page I made yesterday is hidden by another page and I cannot pursue.. Is there a way to learn the process, also I see a contradiction with ILIFE 2011, reading about an announ

    I am building a website using IWEB, on my computer, and I am stuck suddenly, the page I made yesterday is hidden by another page and I cannot pursue..
    Is there a way to learn the process, also I see a contradiction with ILIFE 2011, reading about an announcement of Steve Jobs....? that iWeb would not longer be??

    How is the first page hidden by the other page?  Where are you experiencing this problem?  In iWeb's window or in the browser window of the published site? 
    Are you referring to the page's link in your navbar?  If so check the Inspector/Page/Page pane for the "hidden" page and make sure it's set to be included in the navbar. If that's not the problem describe in detail what you mean and include any screenshots you can make of the problem.
    As far as the longevity of iWeb read the following:
    As you now know iWeb and iDVD have been discontinued by Apple. This is evidenced by the fact that new Macs are shipping with iLife 11 installed but without iWeb and iDVD.
    On June 30, 2012 MobileMe will be shutdown. HOWEVER, iWeb will still continue to work but without the following:
    Features No Longer Available Once MobileMe is Discontinued:
    ◼ Password protection
    ◼ Blog and photo comments
    ◼ Blog search
    ◼ Hit counter
    ◼ MobileMe Gallery
    Currently if the site is published directly from iWeb to the 3rd party server the RSS feed and slideshow subscription features will work. However, if the site is first published to a folder on the hard drive and then uploaded to the sever with a 3rd party FTP client those two features will be broken.
    All of these features can be replaced with 3rd party options.
    There's another problem and that's with iWeb's popup slideshows.  Once the MMe servers are no longer online the popup slideshow buttons will not display their images.
    Click to view full size
    However, Roddy McKay and I have figured out a way to modify existing sites with those slideshows and iWeb itself so that those images will display as expected once MobileMe servers are gone.  How to is described in this tutorial: iW14 - Modify iWeb So Popup Slideshows Will Work After MobileMe is Discontinued.
    NOTE: the iLife 11 boxed version Is no longer available at the online Apple Store.  To get a copy you'll have to try Amazon.com or eBay.com.
    This may be of interest to you: Life After MobileMe.
    OT

  • Is there any way to interrupt the sleeping thread ?

    Is there any way to interrupt the sleeping thread ?
    regards,
    namanc

    Thread.interrupt, very
    sneakily hidden by being in the javadocs under the
    class you know you're using, as a method named by what
    you want to do.:o)
    Here's more:
    Java's Thread Tutorial
    JavaWorld: Introduction to Java threads
    IBM: Introduction to Java threads
    Google: java+threads+tutorial

  • Is there a way to control which processes should run or not ?

    I have a mac with Snow Leopard and was wondering if there was an app or some other way to control which processes run at startup and which dont etc ? I made a new user account and logged in and noticed that it ran like brand new. It loaded up faster and smoother than my normal account. I looked at the processes running and noticed that this new account loads up like a 4th of the processes my main account runs at startup . How can i make my main account run the same processes only so it will run as smooth and fast ? is there an app for this ? thanks (an app that also tells me what each process is for will help too so i can close the processes that i dont need and so that i dont have to close them every time i reboot, but that it will also stop them from automatically loading)
    Message was edited by: Pianohero

    most of the apps that would run at login (which btw is different from startup) automatically are things in the login items. there may be a few items in homedirectory/library/lauchagents but that would be the only place. other than that what runs at login on one account will run on the other. note however, that if you remove any launchdaemons from homedirectory/library/lauchagents the apps that made them may not work properly depending on what those launch daemons do.
    what 50 other processes are you referring to that you see on your main account? most of the stuff you see in the activity monitor are system processes that should not be removed. normally they hardly consume any CPU or RAM.
    Message was edited by: V.K.

  • HT1541 i need to gift paid App to my subscriber base free, how can i do it? is there any way to automate the process it? i dont mind paying for it

    Hi,
    I have a plan of gifting popular gaming app to my user base based on certain criteria.
    I'm aware that you can gift the app through itunes.
    What i want to know if there is any way to automate the process, like any api calls to gift the app to my user base?
    Any sugestion will be most welcome
    Affu

    Hi affu_india,
    If you are looking to do volume gifting of an app, you may find the following page helpful:
    Apple - Business - Volume Purchase Program for Business
    http://www.apple.com/business/vpp/
    Regards,
    - Brenden

  • Is there a way two start a new thread from a BLS to do some background work

    Hi all-
    I am thinking about creative ways to do offline processing...  Our MII app loads a list of current orders for the user's browser.  The user selects an order and requests back to MII for running the SAP transactions.  Then their browser is reloaded with the up to date list again.  When SAP is down they cannot process.
    Certainly a traditional store and forward where all data is loaded to MII and transaction requests are queued up to be processed by MII/SAP in the background is possible. Con: Data synch issues are very complex however.  Pro: It does provide excellent response time to the user.
    I am just noodling about options... 
    >>Is there a way to start a thread that could take the XML output going to the web page and store that in the database in the background?  I.E.  release the data to the irpt and terminate the user's BLS while a background BLS is saving a copy of the XML/orders to the database.
    Then when offline, the user can work from the last current list of orders they had.  When SAP comes back up the system goes back to online operation.  Thus the data sync would only be temporary.  It does not have the response time benefit however.  Maybe some more thinking, ...But I really want to know if there is a way to multi-thread this app.
    Thanks,
    --Amy Smith
    --Haworth

    I assume you're still running 12.0?  12.1 introduces a new action block for transaction calls, which allows for async threads to nested transaction calls.
    I don't know how using query caching would work on the XacuteQuery template for your list of orders - especially when it would attempt to renew the cache when SAP was unavailable.
    An XML file periodically saved to the web tab of your project would also provide you with a cache approach to servicing the user screen - a simple point of abstraction.

  • Wasn't there a way to display replies as threaded?

    Didn't there used to be a way to display replies as threaded?
    By that I mean:
    Post
    response 1
    response 5, responding to 1
    response 3, responding to 1
    response 2, responding to top
    response 4, responding to 2
    rather than straight chronological so that you could easily see who people were replying to?
    I can't seem to find that option anywhere, although I swear it used to be there.  Am I imagining that?
    Thanks in advance.

    If in doubt you can always click on link by "in response to: <username>". Cleverly disguised as a user name, it actually takes you to the message that was responded to.
    Edited by: Mike Pokraka on Jan 19, 2009 12:13 AM - actually I noticed clicking on the little arrow also does it.

  • Is there any way to stop a process execution (all instances)

    Hello,
    I´d like to know if there is any way to stop a specific process for execution at the engine without need to undeploy it, since we don´t want to loose process instances when we need to start this process for execution latter on.
    We have a PRD environment with a lot of processes from different departments (developed by different teams and external suppliers) and a feature for stop a specific process and isolate the environment could be very good to do root cause analysis when issues occurs at the environment.
    Sometimes stop a specific process (or some of them) could help in issues investigation that causes the engine to malfunction (lot of audit enabled, some loop bad controlled, lot of concurrent access) but I could not see this option at the webconsole.
    In the version 5.7 one EAR was created separatedly for each process deployed and this could be done stopping the EAR created for that process. Anyone know how to do this at version 6?
    Thanks

    Well the bad news is you are right, there really isn't any way to do this in versions after 5.7
    Starting at 6.0 all projects are deployed under the 'engine ear'. So if you stop the engine, you stop all projects deployed.
    I'm a little concerned that you are first seeing these issues in a 'PRD' environment, is this something that you could set up in a DEV, or UAT, or SIT, or any other environment (That is built similarly) to recreate the issues? - Then undeploy any of the other projects... and isolate the problem...
    -Kevin

  • Is there a way to trigger batch process via Applescript or Javascript?

    Based on what I've found so far on the internet, the answer is no. The Applescripts I've found so far that attempt to run a batch process don't work for me in either Acrobat Pro 8 or Pro 9.
    I've been using Applescript to automate a process that starts in InDesign (create PDFs), then goes to Acrobat to set open options (I've got a batch process for that but can't find a way to trigger it). If I can get that to work, I'll attempt to automate the task of using a Photoshop droplet to create JPEGs of a specific size from these PDFs.
    I've settled on InDesign CS3 for creating single-page PDFs from a multiple-page document, partly because I could not find a scriptable way to do this in Acrobat. I know just enough about Applescript to be dangerous. I know much less about Javascript.
    Any help would be appreciated.
    Thanks,
    Kevin Stauffer

    Kevin some thing like this for Photoshop should aid you
    set Todays_Date to do shell script "date \"+%d-%m-%y\""
    -- Create new folder to save to
    tell application "Finder"
    set Raster_Images to make new folder at desktop with properties ¬
    {name:"Rasterized PDF's " & Todays_Date}
    end tell
    -- Set Photoshop settings
    tell application "Adobe Photoshop CS2"
    activate
    set display dialogs to never
    set User_Rulers to ruler units of settings
    set ruler units of settings to pixel units
    -- set background color to {class:CMYK color, cyan:0, magenta:0, yellow:0, black:0}
    -- set foreground color to {class:CMYK color, cyan:0, magenta:0, yellow:0, black:100}
    end tell
    -- Get list of PDF's
    set The_Question to "Do you want to include all the subfolders" & return & "within your folder selection?"
    set The_Dialog to display dialog The_Question buttons {"No", "Yes"} default button 1 with icon note
    if button returned of The_Dialog is "Yes" then
    set Input_Folder to choose folder with prompt "Where is the top level folder of PFD's?" without invisibles
    tell application "Finder"
    set File_List to (files of entire contents of Input_Folder whose name extension is "pdf")
    end tell
    else
    tell application "Finder"
    set Input_Folder to choose folder with prompt "Where is the folder of PFD's?" without invisibles
    set File_List to (files of Input_Folder whose name extension is "pdf")
    end tell
    end if
    set File_Count to count of File_List
    if File_Count = 0 then
    display dialog "This folder contains no PDF files to rasterize!" giving up after 2
    end if
    -- Loop through the files in list
    repeat with This_File in File_List
    tell application "Finder"
    set The_File to This_File as alias
    end tell
    -- Tiger (OSX.4) shell call to count the pages
    set Page_Count to my PDF_Pages(POSIX path of The_File)
    if the result is not false then
    -- Loop Photoshop through the page count
    repeat with i from 1 to Page_Count
    tell application "Adobe Photoshop CS2"
    activate
    open The_File as PDF with options ¬
    {class:PDF open options, bits per channel:eight, constrain proportions:true, crop page:trim box, mode:CMYK, page:i, resolution:300, suppress warnings:true, use antialias:true, use page number:true}
    set Doc_Ref to the current document
    tell Doc_Ref
    flatten
    -- Enter your name strings into two enties below
    -- Case sensitive stings
    -- do action "My Action" from "My Action Set"
    -- New file naming options
    set Doc_Name to name
    set ASTID to AppleScript's text item delimiters
    set AppleScript's text item delimiters to " "
    set Doc_Name to text items of Doc_Name
    set AppleScript's text item delimiters to "_"
    set Doc_Name to Doc_Name as string
    set AppleScript's text item delimiters to "-"
    set Doc_Name to text item 1 of Doc_Name
    set AppleScript's text item delimiters to ASTID
    if Page_Count = 1 then
    set New_File_Name to (Raster_Images as string) & Doc_Name & ".tif"
    else
    set File_Number to ""
    repeat until (length of (File_Number as text)) = (length of (Page_Count as text))
    if File_Number = "" then
    set File_Number to i
    else
    set File_Number to "0" & File_Number
    end if
    end repeat
    set New_File_Name to (Raster_Images as string) & Doc_Name & "_" & File_Number & ".tif"
    end if
    end tell
    save Doc_Ref in file New_File_Name as TIFF with options {byte order:Mac OS, embed color profile:false, image compression:LZW, save alpha channels:false, save layers:false}
    close current document without saving
    end tell
    end repeat
    end if
    end repeat
    -- Set ruler units back to user prefs
    tell application "Adobe Photoshop CS2"
    set ruler units of settings to User_Rulers
    end tell
    beep 3
    -- OSX Tiger shell handler
    on PDF_Pages(This_PDF)
    try
    do shell script "/usr/bin/mdls -name kMDItemNumberOfPages" & space & quoted form of This_PDF & " | /usr/bin/grep -o '[0-9]\\+$'"
    on error Error_Message number Error_Number
    if Error_Number is 1 then
    display alert "Page Count Unavailable" message "The page count for " & This_PDF & " is unavailable." giving up after 3
    return false
    else
    display alert "Error " & Error_Number message Error_Message giving up after 3
    return false
    end if
    end try
    end PDF_Pages
    and something like this to perform JavaScript from within AppleScript for Acrobat
    You would be better talking to the JavaScript Experts on how to use addScript() to get your doc level scripts in.
    property Default_Path : (path to desktop folder as Unicode text) as alias
    property JavaScript : "var re = /.*\\/|\\.pdf$/ig; var filename = this.path.replace(re,''); try { for (var i = 0; i < this.numPages; i++) this.extractPages( { nStart: i, cPath: filename+'_' + (i+1) +'.pdf' }); } catch (e) { console.println('Aborted: '+e) }" as text
    set The_PDF to choose file default location Default_Path ¬
    with prompt "Where is the multi-page PDF?" without invisibles
    tell application "Adobe Acrobat 7.0 Professional"
    activate
    open The_PDF
    tell active doc
    do script JavaScript
    close saving yes
    end tell
    end tell

  • Is there a way to abort transformation from an Expert Routine?

    I need to abort processing on a load if a certian condition is hit.  I have figured out how to populate the monitor entries from the expert routine, but not how to halt execution.  The effect I'm looking for is the same as raising exception CX_RSROUT_ABORT in a start or end routine.
    Thanks,
    Scott

    I found  Note 1227667 - Guidelines for expert routine: Design rules which shows method CALL METHOD cl_rstran_expert_rout_srv=>send_message
    Unfortunalty you must be at Support package 18 or use note Note 1165167 - Message interface for expert routine to expose the feature.
    This can be used to send a message to the DTP monitor.  I have not been able to test it to see if it will actually abort or not.

  • Is there any way to reverse iDVD process?

    I make DVDs from iMovie in both PAL and NTSC frequently. As a rule the PALs are sent to Europe and I keep no copy other than the NTSC copy of the same content for my own use. Sometimes I get a request for an additional PAL copy of the same film.
    It would be great to take the finished NTSC DVD to create an image, and then use it to create a PAL copy. To do this properly one would have to convert the image back to an iDVD file and then convert that back to iMovie media files, and then start over with PAL preferences set in both iMovie and iDVD.
    *Is there any software to do this?* I have "Aimersoft DVD Ripper.app" to create a Quicktime .mov file from a DVD, but cannot make a good quality PAL copy with it. I suppose It would be necessary to create .dv files for iMovie.

    Your NTSC project probably will play on the European PAL machines, so you may not have to go through the duplicative process. At least, my European friends tell me that they can do it.
    I believe, but not entirely sure, that you will have to start all over again if you want to make a PAL project after you have created a NTSC project. At least, I am not aware of any software that lets you convert. But perhaps others more familiar with the PAL/NTSC issue will have some helpful comments.

  • Is there a way to change log processing settings?

    The new log processing feature is awesome! I just find the Blackmagic Production Camera 4K setting not very accurate. The yellow seems to be very saturated for me, among other things.  It would be nice to include other LUTs in that pop up menu.  Is there any workaround?  I know about the "LUT utility" and I am using it, but setting the right gamma curve and colors from the media browser without render would be a lot better.
    Adriano Plotzki

    Hi,
    a quick look at the JavDocs (http://docs.oracle.com/cd/E23549_01/apirefs.1111/e10686/oracle/adf/share/config/ADFConfigImpl.html) tell you : No
    Frank

Maybe you are looking for

  • Can't get webutil working on AS

    Hi All, As topic, I can't get webutil working on the application server. I can run individual forms or sessions that do not utilise webutil. As soon as I have baseHTMLjinitiator/baseHTMLjpi/baseHTML defined in the bit of the formsweb.cfg that I am us

  • Scale base value calculation ( Pricing!!)

    Hello, I have issue, when I am creating a credit memo request (Va01 – order type is customized) with reference to billing document. All the items and prices are copied properly. But the scale base value is not copied properly. In the credit memo requ

  • Where can I download the pure java edition app server for windows

    Where can I download a copy of the uncertified windows version of the app server listed below? OracleAS Java Edition v9.0.4 Oracle HTTP Server OracleAS Containers for J2EE Oracle Enterprise Manager OracleAS TopLink Oracle JDeveloper Currently certifi

  • Help with adobe flash player download

    I have a macbook OS X 10.5.8 and I am unable to download adobe flash player

  • Reset the PMU/firewire keeps failing after a bit

    Ok, originally I was having trouble with a bunch of different functions after I replaced the internal battery and finally came to the solution of resetting the PMU button. I was experiencing trouble with the firewire ports before i reset everything a