You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by Rajat Khandelwal <ra...@gmail.com> on 2017/05/04 08:00:58 UTC
Review Request 58986: LENS-1418: LensClient is not thread safe
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs
-----
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
Diff: https://reviews.apache.org/r/58986/diff/1/
Testing
-------
Thanks,
Rajat Khandelwal
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
> On May 5, 2017, 10:17 a.m., Puneet Gupta wrote:
> > lens-client/src/main/java/org/apache/lens/client/LensClient.java
> > Line 161 (original), 169 (patched)
> > <https://reviews.apache.org/r/58986/diff/1/?file=1708224#file1708224line170>
> >
> > Are we clearing the statementMap at any point ?
No.
- Rajat
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/#review173999
-----------------------------------------------------------
On May 4, 2017, 1:30 p.m., Rajat Khandelwal wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58986/
> -----------------------------------------------------------
>
> (Updated May 4, 2017, 1:30 p.m.)
>
>
> Review request for lens.
>
>
> Bugs: LENS-1418
> https://issues.apache.org/jira/browse/LENS-1418
>
>
> Repository: lens
>
>
> Description
> -------
>
> Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
>
>
> Diffs
> -----
>
> lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
>
>
> Diff: https://reviews.apache.org/r/58986/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Rajat Khandelwal
>
>
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
> On May 5, 2017, 10:17 a.m., Puneet Gupta wrote:
> > lens-client/src/main/java/org/apache/lens/client/LensClient.java
> > Line 161 (original), 169 (patched)
> > <https://reviews.apache.org/r/58986/diff/1/?file=1708224#file1708224line170>
> >
> > Are we clearing the statementMap at any point ?
>
> Rajat Khandelwal wrote:
> No.
Adding one more change: `getStatment` should not fail if the client object hasn't been used to fire any queries. So `getStatement` will return `getLatestStatement` in such case.
- Rajat
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/#review173999
-----------------------------------------------------------
On May 4, 2017, 1:30 p.m., Rajat Khandelwal wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58986/
> -----------------------------------------------------------
>
> (Updated May 4, 2017, 1:30 p.m.)
>
>
> Review request for lens.
>
>
> Bugs: LENS-1418
> https://issues.apache.org/jira/browse/LENS-1418
>
>
> Repository: lens
>
>
> Description
> -------
>
> Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
>
>
> Diffs
> -----
>
> lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
>
>
> Diff: https://reviews.apache.org/r/58986/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Rajat Khandelwal
>
>
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Puneet Gupta <pu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/#review173999
-----------------------------------------------------------
lens-client/src/main/java/org/apache/lens/client/LensClient.java
Line 161 (original), 169 (patched)
<https://reviews.apache.org/r/58986/#comment247094>
Are we clearing the statementMap at any point ?
- Puneet Gupta
On May 4, 2017, 8 a.m., Rajat Khandelwal wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58986/
> -----------------------------------------------------------
>
> (Updated May 4, 2017, 8 a.m.)
>
>
> Review request for lens.
>
>
> Bugs: LENS-1418
> https://issues.apache.org/jira/browse/LENS-1418
>
>
> Repository: lens
>
>
> Description
> -------
>
> Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
>
>
> Diffs
> -----
>
> lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
>
>
> Diff: https://reviews.apache.org/r/58986/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Rajat Khandelwal
>
>
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
(Updated May 5, 2017, 5 p.m.)
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs (updated)
-----
lens-cli/src/test/java/org/apache/lens/cli/TestLensQueryCommands.java e1eaae5bde4718dc91982506a6b8619ff9872225
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
src/site/apt/user/cli.apt caffda7d60f3001883e4922096807fe07a939bab
Diff: https://reviews.apache.org/r/58986/diff/7/
Changes: https://reviews.apache.org/r/58986/diff/6-7/
Testing
-------
Thanks,
Rajat Khandelwal
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Puneet Gupta <pu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/#review174017
-----------------------------------------------------------
Ship it!
Ship It!
- Puneet Gupta
On May 5, 2017, 11:17 a.m., Rajat Khandelwal wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58986/
> -----------------------------------------------------------
>
> (Updated May 5, 2017, 11:17 a.m.)
>
>
> Review request for lens.
>
>
> Bugs: LENS-1418
> https://issues.apache.org/jira/browse/LENS-1418
>
>
> Repository: lens
>
>
> Description
> -------
>
> Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
>
>
> Diffs
> -----
>
> lens-cli/src/test/java/org/apache/lens/cli/TestLensQueryCommands.java e1eaae5bde4718dc91982506a6b8619ff9872225
> lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
> src/site/apt/user/cli.apt caffda7d60f3001883e4922096807fe07a939bab
>
>
> Diff: https://reviews.apache.org/r/58986/diff/6/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Rajat Khandelwal
>
>
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
(Updated May 5, 2017, 4:47 p.m.)
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs (updated)
-----
lens-cli/src/test/java/org/apache/lens/cli/TestLensQueryCommands.java e1eaae5bde4718dc91982506a6b8619ff9872225
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
src/site/apt/user/cli.apt caffda7d60f3001883e4922096807fe07a939bab
Diff: https://reviews.apache.org/r/58986/diff/6/
Changes: https://reviews.apache.org/r/58986/diff/5-6/
Testing
-------
Thanks,
Rajat Khandelwal
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
(Updated May 5, 2017, 2:35 p.m.)
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs (updated)
-----
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
src/site/apt/user/cli.apt caffda7d60f3001883e4922096807fe07a939bab
Diff: https://reviews.apache.org/r/58986/diff/5/
Changes: https://reviews.apache.org/r/58986/diff/4-5/
Testing
-------
Thanks,
Rajat Khandelwal
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Puneet Gupta <pu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/#review174011
-----------------------------------------------------------
lens-regression/src/main/java/org/apache/lens/regression/core/helpers/ServiceManagerHelper.java
Lines 67 (patched)
<https://reviews.apache.org/r/58986/#comment247108>
Is this required ?
lens-regression/src/main/java/org/apache/lens/regression/util/Util.java
Lines 107 (patched)
<https://reviews.apache.org/r/58986/#comment247105>
Is this needed ?
- Puneet Gupta
On May 5, 2017, 8:22 a.m., Rajat Khandelwal wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58986/
> -----------------------------------------------------------
>
> (Updated May 5, 2017, 8:22 a.m.)
>
>
> Review request for lens.
>
>
> Bugs: LENS-1418
> https://issues.apache.org/jira/browse/LENS-1418
>
>
> Repository: lens
>
>
> Description
> -------
>
> Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
>
>
> Diffs
> -----
>
> lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
> lens-regression/src/main/java/org/apache/lens/regression/core/helpers/ServiceManagerHelper.java 2370f3e8e2ce1dc4fa95cbce716355a7cf75a2d8
> lens-regression/src/main/java/org/apache/lens/regression/util/Util.java 80ba912f43de4686f27732c54647a715f0514387
> src/site/apt/user/cli.apt caffda7d60f3001883e4922096807fe07a939bab
>
>
> Diff: https://reviews.apache.org/r/58986/diff/4/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Rajat Khandelwal
>
>
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
(Updated May 5, 2017, 1:52 p.m.)
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs (updated)
-----
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
lens-regression/src/main/java/org/apache/lens/regression/core/helpers/ServiceManagerHelper.java 2370f3e8e2ce1dc4fa95cbce716355a7cf75a2d8
lens-regression/src/main/java/org/apache/lens/regression/util/Util.java 80ba912f43de4686f27732c54647a715f0514387
src/site/apt/user/cli.apt caffda7d60f3001883e4922096807fe07a939bab
Diff: https://reviews.apache.org/r/58986/diff/4/
Changes: https://reviews.apache.org/r/58986/diff/3-4/
Testing
-------
Thanks,
Rajat Khandelwal
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
(Updated May 5, 2017, 12:23 p.m.)
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs (updated)
-----
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
Diff: https://reviews.apache.org/r/58986/diff/3/
Changes: https://reviews.apache.org/r/58986/diff/2-3/
Testing
-------
Thanks,
Rajat Khandelwal
Re: Review Request 58986: LENS-1418: LensClient is not thread safe
Posted by Rajat Khandelwal <ra...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58986/
-----------------------------------------------------------
(Updated May 5, 2017, 12:22 p.m.)
Review request for lens.
Bugs: LENS-1418
https://issues.apache.org/jira/browse/LENS-1418
Repository: lens
Description
-------
Using one lens client to fire two queries in two threads results in discrepencies. LensClient has a {{Map<QueryHandle, LensStatement>}} and also has a cached instance of {{LensStatement}}. When two threads fire queries, both use the same statement object. {{LensStatement}} object in turn caches {{LensQuery}} Object. So whichever thread fired query last is the last one to set lens query inside statement causing {{LensClient.getStatement().getQuery()}} to return that query object for all threads.
Diffs (updated)
-----
lens-client/src/main/java/org/apache/lens/client/LensClient.java e9367988fa780ed0ca3e2a2698226e43c011777f
Diff: https://reviews.apache.org/r/58986/diff/2/
Changes: https://reviews.apache.org/r/58986/diff/1-2/
Testing
-------
Thanks,
Rajat Khandelwal