Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Architecture change : Using filesystem i/o in real time isn't suitable #2

Open
FreeLiveTutor opened this Issue · 0 comments

1 participant

@FreeLiveTutor
Collaborator

Have got much more logging and feel I better understand the issues now. Check out this typical log :

*******************************************
Tue, 24 Sep 21:07:50 :ALERT : Listening....
*******************************************
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=0. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /local
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. No Cookie Found. Created fresh uuid : 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. Waiting 0ms to set bundles=1 of 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=0. Served <bundle>: local
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. Waiting 1ms to set bundles=1 of 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. No Historic session found. Creating new session file.
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with bundles=1
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. Saved  {"bundles":1} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=0. Saved  {"bundles":1} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=1. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /FLTsessionAppStyle.css
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=2. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /FLTsessionApp.bundle
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Waiting 0ms to set bundles=1 of 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=2. Served <bundle>: FLTsessionApp
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=3. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /Bootstrap_App.js
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Waiting 1ms to set bundles=1 of 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Waiting 2ms to set bundles=1 of 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=1. Historic session loaded : {"bundles":1}
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=1. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with files=1
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=1. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=1. Saved  {"bundles":1,"files":1} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=1. Served : ../iPad/HTML/FLTsessionAppStyle.css as text/css
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Historic session loaded : {"bundles":1}
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=3. Historic session loaded : {"bundles":1}
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=3. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with files=1
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=3. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=3. Saved  {"bundles":1,"files":1} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=3. Served : ../iPad/App/Bootstrap_App.js as text/javascript
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with bundles=2
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=2. Saved  {"bundles":2} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=4. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /Bootstrap_WebWorker.js
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=4. Historic session loaded : {"bundles":2}
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=4. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with files=1
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=4. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=4. Saved  {"bundles":2,"files":1} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=4. Served : ../iPad/App/Bootstrap_WebWorker.js as text/javascript
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=5. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /Element_Array.png
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=5. Historic session loaded : {"bundles":2,"files":1}
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=5. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with files=2
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=5. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=5. Saved  {"bundles":2,"files":2} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=5. Served : ../Assets/iPad/Element_Array.png as image/png
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=6. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /writingpaper_notebook.jpg
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=6. Historic session loaded : {"bundles":2,"files":2}
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=6. Set 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5 with files=3
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=6. Ending http response and saving session 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=6. Saved  {"bundles":2,"files":3} as ./sessions/56c260c8-efb1-4eeb-aaa5-a56c1561e6c5.json
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=6. Served : ../Assets/iPad/writingpaper_notebook.jpg as image/jpeg
Tue, 24 Sep 21:07:53 :COMMS : HTTP: Request=7. 127.0.0.1  (Mac; Intel Mac OS X 10_8_4) a/537.36  Chrome/28.0.1500.95 Safari/537.36 >>> /WebWorker.bundle
Tue, 24 Sep 21:07:53 :COMMS : SP+ : Request=7. Waiting 0ms to set bundles=1 of 56c260c8-efb1-4eeb-aaa5-a56c1561e6c5

It can be seen that the issue is not about preventing conflicts from accessing the session data within the same request, but from prior and subsequent requests that are often overlapping. This approach is going to be nearly impossible, short of storing the 'being_modified' flags globally to the module.

In which case, I think it would be better to store the data in memory as an object, and only write the data to file as the request session is ended.
Note - the only time session data would be read from file is at launch of server.
This would avoid the rapid succession of read>>parse>>modify>>write that end of overlapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.