Ticket #3137 (closed defect: fixed)
WFS layer: possible race condition
| Reported by: | assefa | Owned by: | dmorissette |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.0 release |
| Component: | WFS Client | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | jimk, assefa, aboudreault, sdlime |
Description
reported by jimk (as part of #3136)
I also found what appears to be a race condition in the creation of the temporary GML file. The problem occurs when bPostRequest is false and two similar requests occur at nearly the same time (in my case one with mode=map and an identical one but with mode=nquery&searchmap=true). Then both requests use the same filename for the temporary file which causes one of the two requests to fail. The problem code is in mapwfslayer.c lines 649-659.
Forcing the condition of the if statement to true eliminates the problem, but probably eliminates some caching efforts.
if (bPostRequest) // expect race condition between two requests causing second to fail with same URL if bPostRequest is false
{
char *pszPostTmpName = NULL;
pszPostTmpName = (char *)malloc(sizeof(char)*(strlen(pszURL)+128));
sprintf(pszPostTmpName,"%s%ld%d",
pszURL, (long)time(NULL), (int)getpid());
pszHashFileName = msHashString(pszPostTmpName);
free(pszPostTmpName);
}
else
pszHashFileName = msHashString(pszURL);
Change History
Note: See
TracTickets for help on using
tickets.
