Developer forum

Forum » Ecommerce - Standard features » Does the old index store state in the database?

Does the old index store state in the database?

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

We have a load balanced setup using DFS where all files are automatically synced. This causes locking issues with the index files, so we've excluded the _search folder. This means the index UI in the Management Center no longer works for us as it would only update the current server. To overcome this, we developed a simple module that executes the following URLs for the connected nodes:

http://10.10.86.10/Admin/Public/IndexUpdateTask.ashx?Path=Products&FullUpdate=True
http://10.10.86.20/Admin/Public/IndexUpdateTask.ashx?Path=Products&FullUpdate=True
http://10.10.86.50/Admin/Public/IndexUpdateTask.ashx?Path=Products&FullUpdate=True

This works OK when I execute each URL individually. However from my module I am executing all three of them in parallel which leads to the following error:

This instance has already started one or more requests. Properties can only be modified before sending the first request.

It seems that the indexing state is kept in the database, causing the first server to accept the request and build the index but the others then fail as Dynamicweb thinks it's already busy building the index.

Is this a correct analysis and is there a way to execute them in parallel? As a work around, I can execute them one by one, but that triples the time it takes to build the index across all nodes.

Thanks,

Imar


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Imar

I do not think DW does that.

The exception seems to be coming from HttpClient: http://stackoverflow.com/questions/23790893/dynamically-changing-httpclient-timeout-in-net

Yours or ours?

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Oh wow, I never thought of that. I saw this in the logs of my custom tool and it appeared to be the response from the call to the service, not from the client executing it. I never even bothered to Google for it, thinking it came from Dynamicweb (with "instance" referring to the indexer).

I now see this is defintely mine. I am using some async tasks to schedule the index updates in parallel, reusing a single instance of HttpClient. The method that executes the request does indeed change a property (a timeout), so the second and subsequent calls would result in this error message.

Thank you; you just made my day (or evening, actually)

Imar

 

You must be logged in to post in the forum