Home > Back-end >  The child thread it
The child thread it

Time:09-21

Recently met a problem, consult everybody Montana
Front end through ajax sends a request to the backend excutorProcess method
 public void excutorProcess (final HttpSession session, final it the req) {

Opened this method more child thread, at the same time, the front desk into it with a final modification for each child threads, the child thread processing business alone, directly back to the main thread, in the main thread after return, front end call ajax to refresh the list again, only to find that the background can't get to all the incoming parameters, see the HTTP request parameters have no problem found, if again to refresh the list of the parameters of normal
A mystery for bosses to solve this problem

CodePudding user response:

Should from the request to get the data to the child thread, rather than pass the request to the child thread

CodePudding user response:

reference 1/f, slip into a man of all ages reply:
should be from the request to get the data to the child thread, rather than pass the request to the child thread

Want to ask if the request directly to the child thread will have what effect?
Currently found no problem under the tomcat7, but under tomcat8 affect page ajax requests to the second

CodePudding user response:

refer to the second floor loveaeen response:
Quote: refer to 1st floor stumble into a man of all ages reply:

Should from the request to get the data to the child thread, rather than pass the request to the child thread

Want to ask if the request directly to the child thread will have what effect?
Currently found no problem under the tomcat7, but affects the secondary of page ajax request under tomcat8

Don't know the right, in view of the phenomenon you said, here are personal speculation:
Modern web container opens the keepalive commonly, after a link up, your personal thread holds the link, the container has return immediately, front end with the same link again request (because keepalive), and the actual this link is not your child thread release, lead to errors,

CodePudding user response:

Should from the request to get the data to the child thread, rather than pass the request to the child thread

CodePudding user response:

references reply slip into a man of all ages: 3/f
Quote: refer to the second floor loveaeen response:

Quote: refer to 1st floor stumble into a man of all ages reply:

Should from the request to get the data to the child thread, rather than pass the request to the child thread

Want to ask if the request directly to the child thread will have what effect?
Currently found no problem under the tomcat7, but affects the secondary of page ajax request under tomcat8

Don't know the right, in view of the phenomenon you said, here are personal speculation:
Modern web container opens the keepalive commonly, after a link up, your personal thread holds the link, container will return immediately, front end with the same link again request (because keepalive), and the actual this link is not your child thread release, lead to errors,

If according to this guess indeed possibility is very large, but if I do the same operation under tomcat7, will not produce the problem, the ajax request there will be no exception (probably dozens of times there will be an unusually inside, but you don't like tomcat8 must appear)

CodePudding user response:

Will related to tomcat connector?
Connector has been changed or by default?
Tomcat7 default bio, tomcat8 default nio, change give it a try

CodePudding user response:

refer to 6th floor ITjavaman response:
will not be associated with tomcat connector?
Connector has been changed or by default?
Tomcat7 default bio, tomcat8 default nio, try change

Tested the tomcat7 nio or bio patterns are normal,

CodePudding user response:

reference 5 floor loveaeen reply:
Quote: refer to the third floor slip into a man of all ages reply:

Quote: refer to the second floor loveaeen response:

Quote: refer to 1st floor stumble into a man of all ages reply:

Should from the request to get the data to the child thread, rather than pass the request to the child thread

Want to ask if the request directly to the child thread will have what effect?
Currently found no problem under the tomcat7, but affects the secondary of page ajax request under tomcat8

Don't know the right, in view of the phenomenon you said, here are personal speculation:
Modern web container opens the keepalive commonly, after a link up, your personal thread holds the link, container will return immediately, front end with the same link again request (because keepalive), and the actual this link is not your child thread release, lead to errors,

If according to this guess indeed possibility is very large, but if I do the same operation under tomcat7, will not produce the problem, the ajax request there will be no exception (probably dozens of times there will be an unusually inside, but you don't like tomcat8 must appear)

Tomcat keep alive - closed, a try

CodePudding user response:

refer to stumble into a man of all ages 8 floor response:
Quote: refer to the fifth floor loveaeen reply:

Quote: refer to the third floor slip into a man of all ages reply:

Quote: refer to the second floor loveaeen response:

Quote: refer to 1st floor stumble into a man of all ages reply:

Should from the request to get the data to the child thread, rather than pass the request to the child thread

Want to ask if the request directly to the child thread will have what effect?
Currently found no problem under the tomcat7, but affects the secondary of page ajax request under tomcat8

Don't know the right, in view of the phenomenon you said, here are personal speculation:
Modern web container opens the keepalive commonly, after a link up, your personal thread holds the link, container will return immediately, front end with the same link again request (because keepalive), and the actual this link is not your child thread release, lead to errors,

If according to this guess indeed possibility is very large, but if I do the same operation under tomcat7, will not produce the problem, the ajax request there will be no exception (probably dozens of times there will be an unusually inside, but you don't like tomcat8 must appear)

Tomcat keep alive - shut down, try then know

But tomcat7 and tomcat8 are support keep - the alive, also won't tomcat7 normal tomcat8 fail
  • Related