sparql-client
sparql-client copied to clipboard
Mixing `query` and `update` calls is not thread safe when using a single client instance
One could run into race condition issues when having one client used by multiple threads to run query and update calls. This is due to the use of instance variables in the make_post_request method:
request['Content-Type'] = 'application/sparql-' + (@op || :query).to_s
https://github.com/ruby-rdf/sparql-client/blob/master/lib/sparql/client.rb#L505
Thanks for reporting. I'm not sure that the client is otherwise thread-safe, though; it's encapsulating a single HTTP connection, after all. Will evaluate whether it makes any sense to define it as thread safe when we get around to the next release.