If one looks into the coldfusion application log, the multiple running of the events are all on different threads
"Information","web-90","08/12/09","12:05:08","ECOLLAB","ProjectsListener:Config" "Information","web-90","08/12/09","12:05:08","ECOLLAB","ApplicationPlugin: PreProcess: users.preferences" "Information","web-90","08/12/09","12:05:08","ECOLLAB","SecureRequestPlugin: PreProcess: users.preferences" "Information","web-90","08/12/09","12:05:08","ECOLLAB","ApplicationPlugin: PreEvent:" "Information","web-90","08/12/09","12:05:08","ECOLLAB","Header" "Information","web-97","08/12/09","12:05:08","ECOLLAB","ProjectsListener:Config" "Information","web-97","08/12/09","12:05:08","ECOLLAB","ApplicationPlugin: PreProcess: users.preferences" "Information","web-97","08/12/09","12:05:08","ECOLLAB","SecureRequestPlugin: PreProcess: users.preferences" "Information","web-97","08/12/09","12:05:08","ECOLLAB","ApplicationPlugin: PreEvent:" "Information","web-97","08/12/09","12:05:08","ECOLLAB","Header" Right now I am trying to determine 'when' the second gets fired. I know it's somewhere between the time the gateway function ends and the view pages start as a cfabort in the header does not prevent the second but in the gateway it does. On Aug 12, 11:52 am, davee <[email protected]> wrote: > On Aug 11, 2:51 pm, "Peter J. Farrell" <[email protected]> wrote:> I've never > seen or even heard of any behavior like this before. > > > * What version of Mach-II are you using? > > 1.6.0 > > > * Are you using AJAX to do the form posts? > > I do use ajax for some of the posts, but most are plain vanilla html > posts. I have been seeing this for a while on other applications that > I didn't write but never took the time to track them down. > > > > > I bet if you use an HTTP header sniffer like Live Headers plugin for > > Firefox you'll see two requests being made by the browser. Another > > problem can be if you are using rewrite support in your webserver and > > it's rewriting stuff twice. > > This is happening with the CF development server. I have no access to > production logs so I can't see if it is happening there, but since I > can see it on my localhost, I'm not assuming it can or cannot be seen > on other servers. In any case, it seems incredibly dangerous to allow > a browser to make two posts to the same url and have the second post > omit the request object. I'm not convinced that it is a browser error > since the second event is fired between the time the gateway function > finishes and the view pages are displayed. This is demonstrable by > moving a cfabort around the app. If it's in the gateway or listener > after everything is done, it only executes it once, but if the abort > is in a view page, it seems to spawn a second thread with no request > scope. > > > > > I seriously doubt that it's any particular with the framework going on > > as there would be *a lot* of broken applications in the wild. > > Notice that I explicitly said I knew it was something I was doing, > but don't know enough about the event handling process to properly > debug it since nothing I can see in the app is causing it. I do know > that is is a mach-ii issue, but that doesn't mean that it's not caused > by the application. This is why I'm trying to get to the bottom of it, > so we know what is is to avoid in the future. I could spend the next > couple of weeks stumbling around, but I'd rather not go through that > painful process if it's avoidable. > > > > > .pjf > > > davee said the following on 08/11/2009 10:06 AM: > > > > I have an application that has an interesting problem that I have not > > > yet been able to get a handle on. Here is a synopsis; > > > > After an event has been completely executed, it is executed again > > > without the request scope. > > > > Specifically, when a form is submitted (happens on all browser > > > requested events), the event is processed normally, but after it is > > > finished, the event is triggered again, but this time, the form > > > variables do not exist at all, suggesting that the second instance is > > > being instantiated from within the mach-ii engine somehow. My > > > understanding of this that this should be impossible since the server > > > always passes the request scope to the back end engine. The fact that > > > there is no request scope and looking for the form structure which is > > > supposed to always be sent to the coldfusion engine turns up without > > > it seems impossible, but since it is happening, this is obviously not > > > true. > > > > What I have discovered so far is: > > > > * It's not in the filters > > > * It's not in the pluggins > > > * Almost every event gets triggered this way. > > > * it's not begin reported by the mach-ii logging tools (only shows > > > one instance being executed) > > > * it is being captured by the coldfusion cflog tag > > > * The only manipulation of the event queue is a redirect filter to > > > redirect events to a login and then to the original event. > > > * If I put a cfabort after processing the event (ie, inthe view > > > page or at the end of a function, the second instance never > > > occurs, so the workaround of putting a cfabort at the end of the > > > footer page would effectively stop this, but would also stop any > > > redirects or announces as well > > > * The other workaround is to put a check for the form variable into > > > each listener function and only call the gateway function if it > > > exists, but this only means that the application is doing things > > > we have no understanding of and that is not acceptable. > > > > I have disabled the filters and plugins by; > > > > * removing them from the config files > > > * renaming the functions inside so they can't be called > > > * forcing filters to ALWAYS return true > > > > I've run the skeleton and it does not exhibit this behavior so I know > > > it MUST be something I'm doing. > > > > The way I discovered it was using a function that deleted all records > > > associated with an event and rebuilt them based on the submitted > > > form. The first time, it deleted the records and created the new > > > records. Then it deleted the records and since the form structure, > > > normally in request scope didn't exist, it had nothing to create the > > > new records with and of course suggests that the whole process never > > > happened. but using cflog and cfabort, you can see that it is clearly > > > happening. > > > > My question is this; Before I spend a great deal of time running this > > > to ground, has anyone ever seen this behavior? > > > > Any help would be appreciated. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to Mach-II for CFML list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ -~----------~----~----~----~------~----~------~--~---
