Project

General

Profile

Session refresh

Added by Gamel Jones over 13 years ago

Hi all,

I'm facing a problem and I don't know how to avoid it.

I developped a WT 3.1.10 application that displays, within a WTree, some data.

Sometimes the tab is cleared and as a consequence a new session is created.

I open only one browser (client) and here are the logs I get:

[notice] "Session created (#sessions = 1)"
[notice] "Session created (#sessions = 2)"

My problem is that the first session is not well destroyed.

I tested with WT 3.1.11 and the session is well destroyed.

However I want to avoid the creation of a new session ? How can I do it ?

Maybe the way I update my tree is not correct, how this creation of a new session is triggered ?

As the update is made by another thread I use enableUpdates and lock mechanism to update my HMI.

Thanks in advance,

Regards


Replies (11)

RE: Session refresh - Added by Gamel Jones over 13 years ago

I use a WTableView and not a WTree

my bad

RE: Session refresh - Added by Koen Deforche over 13 years ago

Hey,

A new session is created when a request arrives which does not carry a wtd.

Can you combine the error log with the access log so that we can correlate the new sessions with requests ?

Regards,

koen

RE: Session refresh - Added by Gamel Jones over 13 years ago

Here are the whole logs:

[2011-Dec-19 09:02:48.678438] 3980 [/MyApp NXuscZ3MgjJzmSt5] [notice] "Session created (#sessions = 1)"
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
127.0.0.1 - - [2011-Dec-19 09:02:48.756447] "GET /MyApp HTTP/1.1" 200 3533
127.0.0.1 - - [2011-Dec-19 09:02:53.639779] "GET /MyApp?wtd=NXuscZ3MgjJzmSt5&request=resource&resource=blank HTTP/1.1" 200 63
[2011-Dec-19 09:02:53.873804] 3980 [/MyApp NXuscZ3MgjJzmSt5] [warn] "WApplication::addMetaHeader() with no effect"
127.0.0.1 - - [2011-Dec-19 09:02:54.185838] "GET /MyApp?wtd=NXuscZ3MgjJzmSt5&request=style HTTP/1.1" 200 147
127.0.0.1 - - [2011-Dec-19 09:02:54.279448] "GET /resources//themes/polished/wt_ie.css HTTP/1.1" 200 1760
...
127.0.0.1 - - [2011-Dec-19 09:03:47.325228] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 9289
127.0.0.1 - - [2011-Dec-19 09:03:47.855686] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 19071
127.0.0.1 - - [2011-Dec-19 09:03:48.074110] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 66
[2011-Dec-19 09:03:48.744983] 3980 [/MyApp txvAgZ7mav5w836j] [notice] "Session created (#sessions = 2)"

Each time a new session is created a 66 length request is posted.

Maybe it's linked to the creation but I don't know how to figure out this.

Regards,

RE: Session refresh - Added by Koen Deforche over 13 years ago

Hey Gamel,

The 66 lenght request is possibly related. But we're missing one access log entry though, the

one that follows the "Session created ()", this is the first request of the new session ?

Regards,

koen

RE: Session refresh - Added by Gamel Jones over 13 years ago

Hi,

I start a session, the 66 length request is posted, a new session is created and finally I closed my browser:

Option no-compression is implied because wthttp was built without zlib support.
Reading: c:/witty/wt_config.xml
[2011-Dec-19 09:02:37.367206] 3980 - [notice] "Wt: initializing built-in httpd"
[2011-Dec-19 09:02:37.367206] 3980 - [notice] "Reading Wt config file: c:/witty/wt_config.xml (location = 'D:\localworkspace\ws_vs2010\ziam_MyApp\/build/Release\ziamA_MyApp.exe')"
Option no-compression is implied because wthttp was built without zlib support.
[2011-Dec-19 09:02:37.382807] 3980 - [notice] "Started server: http://0.0.0.0:8080"
[2011-Dec-19 09:02:48.678438] 3980 [/MyApp NXuscZ3MgjJzmSt5] [notice] "Session created (#sessions = 1)"
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
127.0.0.1 - - [2011-Dec-19 09:02:48.756447] "GET /MyApp HTTP/1.1" 200 3533
127.0.0.1 - - [2011-Dec-19 09:02:53.639779] "GET /MyApp?wtd=NXuscZ3MgjJzmSt5&request=resource&resource=blank HTTP/1.1" 200 63
[2011-Dec-19 09:02:53.873804] 3980 [/MyApp NXuscZ3MgjJzmSt5] [warn] "WApplication::addMetaHeader() with no effect"
127.0.0.1 - - [2011-Dec-19 09:02:54.185838] "GET /MyApp?wtd=NXuscZ3MgjJzmSt5&request=style HTTP/1.1" 200 147
127.0.0.1 - - [2011-Dec-19 09:02:54.279448] "GET /resources//themes/polished/wt_ie.css HTTP/1.1" 200 1760
127.0.0.1 - - [2011-Dec-19 09:02:54.357457] "GET /resources//themes/polished/wt.css HTTP/1.1" 200 16700
127.0.0.1 - - [2011-Dec-19 09:02:54.404262] "GET /MyApp?wtd=NXuscZ3MgjJzmSt5&scale=1.0416666666666667&request=script&rand=732403 HTTP/1.1" 200 144172
127.0.0.1 - - [2011-Dec-19 09:02:54.435465] "GET /resources/style/style.css HTTP/1.1" 200 4215
127.0.0.1 - - [2011-Dec-19 09:02:56.104847] "GET /favicon.ico HTTP/1.1" 404 85
127.0.0.1 - - [2011-Dec-19 09:02:56.151652] "GET /resources//themes/default/spin-buttons.png HTTP/1.1" 200 466
127.0.0.1 - - [2011-Dec-19 09:02:56.167254] "GET /resources/calendar_edit.png HTTP/1.1" 200 777
127.0.0.1 - - [2011-Dec-19 09:02:56.198457] "GET /resources/ajax-loading.gif HTTP/1.1" 200 3208
127.0.0.1 - - [2011-Dec-19 09:02:56.385678] "GET /resources/style/titleImage.jpg HTTP/1.1" 200 13681
127.0.0.1 - - [2011-Dec-19 09:02:56.791322] "GET /resources/themes/polished/stripes/stripe-23px.gif HTTP/1.1" 200 110
127.0.0.1 - - [2011-Dec-19 09:02:56.791322] "GET /resources//loading.png HTTP/1.1" 200 5504
127.0.0.1 - - [2011-Dec-19 09:02:59.115975] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 141458
127.0.0.1 - - [2011-Dec-19 09:02:59.552823] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 7790
127.0.0.1 - - [2011-Dec-19 09:02:59.599628] "GET /resources/themes/polished/stripes/stripe-20px.gif HTTP/1.1" 200 106
127.0.0.1 - - [2011-Dec-19 09:02:59.630831] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 608
127.0.0.1 - - [2011-Dec-19 09:03:00.442120] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 1592
127.0.0.1 - - [2011-Dec-19 09:03:00.676145] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 1591
127.0.0.1 - - [2011-Dec-19 09:03:00.707349] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 3000
127.0.0.1 - - [2011-Dec-19 09:03:47.325228] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 9289
127.0.0.1 - - [2011-Dec-19 09:03:47.855686] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 19071
127.0.0.1 - - [2011-Dec-19 09:03:48.074110] "POST /MyApp?wtd=NXuscZ3MgjJzmSt5 HTTP/1.1" 200 66
[2011-Dec-19 09:03:48.744983] 3980 [/MyApp txvAgZ7mav5w836j] [notice] "Session created (#sessions = 2)"
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
127.0.0.1 - - [2011-Dec-19 09:03:48.760585] "GET /MyApp HTTP/1.1" 200 3532
[2011-Dec-19 09:03:48.791788] 3980 [/MyApp txvAgZ7mav5w836j] [warn] "WApplication::addMetaHeader() with no effect"
127.0.0.1 - - [2011-Dec-19 09:03:48.916602] "GET /MyApp?wtd=txvAgZ7mav5w836j&request=style HTTP/1.1" 200 147
127.0.0.1 - - [2011-Dec-19 09:03:48.916602] "GET /MyApp?wtd=txvAgZ7mav5w836j&request=resource&resource=blank HTTP/1.1" 200 63
127.0.0.1 - - [2011-Dec-19 09:03:48.932203] "GET /MyApp?wtd=txvAgZ7mav5w836j&scale=1.0416666666666667&request=script&rand=173275 HTTP/1.1" 200 144493
127.0.0.1 - - [2011-Dec-19 09:03:49.072619] "GET /resources//themes/polished/wt_ie.css HTTP/1.1" 200 1760
127.0.0.1 - - [2011-Dec-19 09:03:49.103822] "GET /resources/style/style.css HTTP/1.1" 200 4215
127.0.0.1 - - [2011-Dec-19 09:03:49.197432] "GET /resources//themes/polished/wt.css HTTP/1.1" 200 16700
127.0.0.1 - - [2011-Dec-19 09:03:49.275441] "GET /favicon.ico HTTP/1.1" 404 85
127.0.0.1 - - [2011-Dec-19 09:03:49.275441] "GET /resources/calendar_edit.png HTTP/1.1" 200 777
127.0.0.1 - - [2011-Dec-19 09:03:49.291043] "GET /resources/ajax-loading.gif HTTP/1.1" 200 3208
127.0.0.1 - - [2011-Dec-19 09:03:49.556271] "GET /resources//themes/default/spin-buttons.png HTTP/1.1" 200 466
127.0.0.1 - - [2011-Dec-19 09:03:49.603077] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 136956
127.0.0.1 - - [2011-Dec-19 09:03:50.195941] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 3511
127.0.0.1 - - [2011-Dec-19 09:03:50.289551] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 3227
127.0.0.1 - - [2011-Dec-19 09:03:51.116441] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 1187
127.0.0.1 - - [2011-Dec-19 09:03:51.397272] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 1504
127.0.0.1 - - [2011-Dec-19 09:03:51.584492] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 2813
127.0.0.1 - - [2011-Dec-19 09:03:51.631298] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 3491
127.0.0.1 - - [2011-Dec-19 09:03:52.411383] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 1629
127.0.0.1 - - [2011-Dec-19 09:03:52.661010] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 2938
127.0.0.1 - - [2011-Dec-19 09:03:52.692213] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 196
[2011-Dec-19 09:031:2752.770222] 3980 [/MyApp txvAgZ7mav5w836j] [notice] "Session destroyed (#sessions = 1.0)."0.1 - - [2011-Dec-19 09:03:52.770222] "POST /MyApp?wtd=txvAgZ7mav5w836j HTTP/1.1" 200 10633

Regards,

RE: Session refresh - Added by Koen Deforche over 13 years ago

Hey,

That's curious. It also affects the behavior, i.e. when the new session is created, it replaces the old one ?

With Wt 3.2.0, compiled in DEBUG mode (-DDEBUG=ON), we would be able to enable debug logging which will show the contents of this 66-byte length message which hopefully gives us a clue. Could you try that ?

Regards,

koen

RE: Session refresh - Added by Gamel Jones over 13 years ago

Hi,

I will try with 3.2.0 compiled in DEBUG mode asap.

I have to reach some important milestones first.

However, is there a display limit with WTableView ?

I mean how many elements can be displayed in a wtableview ?

Regards,

Gamel

RE: Session refresh - Added by Koen Deforche over 13 years ago

Hey,

Yes, the table view is limited by the maximum height of a DOM node (in HTML), and that depends on the browser being used.

The limitation is browser-side only.

Regards,

koen

RE: Session refresh - Added by Gamel Jones over 13 years ago

Hi,

Happy new year ! :-)

I use a software to fill the header of the request (fiddler) and here is the text related the my 66 request

if (window.Wt) window.Wt._p_.quit(); window.location.reload(true);

Maybe it can be a clue.

RE: Session refresh - Added by Gamel Jones over 13 years ago

the full text of the request:

Accept: */*
Accept-Language: fr-FR
Referer: http://x.x.x.x:xxxx/MyApp
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Host: x.x.x.x:xxxx
Content-Length: 46
Connection: Keep-Alive
Pragma: no-cache
userID: yyyy

request=jsupdate&signal=poll&ackId=4&pageId=0&
HTTP/1.1 200
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Length: 66
Content-Type: text/javascript; charset=UTF-8
Expires: 0
Date: Tue, 03 Jan 2012 08:49:23 GMT

if (window.Wt) window.Wt._p_.quit(); window.location.reload(true);

RE: Session refresh - Added by Koen Deforche over 13 years ago

Hey,

That helps. As far as I can see, this behavior could be had with 3.1.10, but should be fixed since 3.1.11. But you also indicated that you got the same problem in 3.1.11?

The logs are from a 3.1.10 session, at least, right ?

But it seems that your code is hitting some kind of race condition in Wt (3.1.10) which might still exist in later versions, and I would be interested in having a reproducible test case to find out if something is still wrong with the current git version.

Regards,

koen

    (1-11/11)