Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: BOSH
    • Labels:
      None

      Description

      There should be a single checking thread that will periodically check to see if there are sessions that passed their inactivity time.
      Right now this is done for every session with Timer.schedule that creates a thread for every session, which is not scalable (the number of threads increases linearly with the number of concurrent sessions).

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        41d 4h 39m 1 Bogdan Pistol 27/Sep/10 01:13
        Resolved Resolved Closed Closed
        139d 20h 32m 1 Niklas Gustavsson 13/Feb/11 20:45
        Niklas Gustavsson made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Niklas Gustavsson made changes -
        Fix Version/s 0.7 [ 12315280 ]
        Fix Version/s 0.6 [ 12314873 ]
        Hide
        Niklas Gustavsson added a comment -

        0.6 has already been released, so fix version should be 0.7

        Show
        Niklas Gustavsson added a comment - 0.6 has already been released, so fix version should be 0.7
        Bogdan Pistol made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.6 [ 12314873 ]
        Resolution Fixed [ 1 ]
        Hide
        Bogdan Pistol added a comment -

        Committed in rev 1001557.

        Show
        Bogdan Pistol added a comment - Committed in rev 1001557.
        Hide
        Bogdan Pistol added a comment -

        You are right if you are using a single Timer instance to schedule n tasks. But in the current implementation there are n instances of Timer, and every instance is used to schedule 1 task, hence using n threads to schedule n tasks (for n sessions), which is inefficient.

        Show
        Bogdan Pistol added a comment - You are right if you are using a single Timer instance to schedule n tasks. But in the current implementation there are n instances of Timer, and every instance is used to schedule 1 task, hence using n threads to schedule n tasks (for n sessions), which is inefficient.
        Hide
        Ashish Paliwal added a comment -

        I don't think this is correct, that Timer.schedule will create a thread for every session.

        Here is note from javadoc

        This class scales to large numbers of concurrently scheduled tasks (thousands should present no problem). Internally, it uses a binary heap to represent its task queue, so the cost to schedule a task is O(log n), where n is the number of concurrently scheduled tasks.

        However, moving to a more simple approach is better.

        Show
        Ashish Paliwal added a comment - I don't think this is correct, that Timer.schedule will create a thread for every session. Here is note from javadoc This class scales to large numbers of concurrently scheduled tasks (thousands should present no problem). Internally, it uses a binary heap to represent its task queue, so the cost to schedule a task is O(log n), where n is the number of concurrently scheduled tasks. However, moving to a more simple approach is better.
        Bogdan Pistol created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Bogdan Pistol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development