[Bug 66519] Read pagination and conversion issues

2023-03-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66519

Dominik Stadler  changed:

   What|Removed |Added

 OS||All

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 66520] Adding new series corrupting Word document

2023-03-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66520

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 66521] ThreadLocal memory leak in Tomcat

2023-03-10 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66521

Dominik Stadler  changed:

   What|Removed |Added

 OS||All
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Dominik Stadler  ---
Apache POI uses thread-locals to improve performance of some operations. 

These are not real memory-leaks, as only a fixed amount of memory is allocated
and used per thread.

However Tomcat seems to perform some check on threads that are "returned to the
pool" and thus warns about these ThreadLocals still holding onto some objects. 


We have now added a method
org.apache.poi.util.ThreadLocalUtil#clearAllThreadLocals() which you can call
to clear out all thread-locals in Apache POI before finishing work inside the
Tomcat web-application.

This will be included in the next release.

See r1908263 for the implementation.

FYI, there is a similar method in XMLBeans which you may also need to call if
you are using code from module poi-ooxml.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[GitHub] [poi] dependabot[bot] commented on pull request #439: Bump org.mockito:mockito-core from 4.11.0 to 5.2.0

2023-03-10 Thread via GitHub


dependabot[bot] commented on PR #439:
URL: https://github.com/apache/poi/pull/439#issuecomment-1464844388

   OK, I won't notify you again about this release, but will get in touch when 
a new version is available. If you'd rather skip all updates until the next 
major or minor version, let me know by commenting `@dependabot ignore this 
major version` or `@dependabot ignore this minor version`. You can also ignore 
all major, minor, or patch releases for a dependency by adding an [`ignore` 
condition](https://docs.github.com/en/code-security/supply-chain-security/configuration-options-for-dependency-updates#ignore)
 with the desired `update_types` to your config file.
   
   If you change your mind, just re-open this PR and I'll resolve any conflicts 
on it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[GitHub] [poi] asfgit closed pull request #439: Bump org.mockito:mockito-core from 4.11.0 to 5.2.0

2023-03-10 Thread via GitHub


asfgit closed pull request #439: Bump org.mockito:mockito-core from 4.11.0 to 
5.2.0
URL: https://github.com/apache/poi/pull/439


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



Re: thread locals in POI code

2023-03-10 Thread Dominik Stadler
Yes, the first approach ended in dependency-conflicts.

Thus my current approach for POI uses a small static registry of
"cleaners", so each class which is using thread-locals registers itself for
cleaning and thus the dependency from scratchpad, ooxml, ... to the core
"poi" is properly handled.

Thanks... Dominik.


On Fri, Mar 10, 2023 at 8:37 PM PJ Fanning 
wrote:

> Thanks Dominik - seems like a valid solution. Ideally, there would be
> separate ThreadLocalUtil-like classes for poi-ooxml and poi-scratchpad
> (XSSF vs HSSF) - and probably poi main jar too.
>
> I was thinking myself more along the lines of supporting a flag to turn
> off the use of ThreadLocals (not the default mode, an opt in). This could
> still be added as a separate util method. I think this latter mode will
> prove use once Virtual Threads become more common.
>
>
>
>
>
>
> On Friday 10 March 2023 at 12:51:40 GMT+1, Dominik Stadler <
> dominik.stad...@gmx.at> wrote:
>
>
>
>
>
> Hi,
>
> Some of them likely have had a valid use-case and would at least cause
> performance issues if removed.
>
> The issues from Tomcat or other WebServers usually come because they check
> if memory is lingering at the point when the thread is "given back" to a
> global pool.
>
> XmlBeans also uses ThreadLocals and there were similar reports some time
> ago. There we provide
>
> https://github.com/apache/xmlbeans/blob/trunk/src/main/java/org/apache/xmlbeans/ThreadLocalUtil.java
> which allows to clean out all ThreadLocals in the current thread and can be
> used in a Web-Application to release stuff at the end if necessary.
>
> I would propose to provide a similar util for POI, I even have an initial
> version of it, but never managed to finish it. Unless you object I can tidy
> it up and add it as solution for anyone having issues with threadlocals.
>
> Dominik.
>
> On Wed, Mar 8, 2023 at 10:09 PM PJ Fanning 
> wrote:
>
> > Hi everyone,
> >
> > We have a lot of open issues about ThreadLocals.
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=66521 was opened today.
> >
> > With Virtual Threads (aka Project Loom), ThreadLocals seem like a bad
> > solution.
> >
> > I've looked at the ThreadLocals in POI a few times and have always
> > struggled to see what they really achieve.
> >
> > Would anyone object if we just simply remove them all?
> >
> > Interacting with individual HSSFWorkbook, XSSFWorkbook and their
> > equivalents using multiple threads seems to be something that we don't
> test
> > much and we could simply say it's a bad idea. Sure, being able to produce
> > multiple separate docs with separate threads is definitely something we
> > want.
> >
> > Does anyone have any thoughts?
> >
> > Regards,
> > PJ
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> > For additional commands, e-mail: dev-h...@poi.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
>
>


Re: thread locals in POI code

2023-03-10 Thread PJ Fanning
Thanks Dominik - seems like a valid solution. Ideally, there would be separate 
ThreadLocalUtil-like classes for poi-ooxml and poi-scratchpad (XSSF vs HSSF) - 
and probably poi main jar too.

I was thinking myself more along the lines of supporting a flag to turn off the 
use of ThreadLocals (not the default mode, an opt in). This could still be 
added as a separate util method. I think this latter mode will prove use once 
Virtual Threads become more common.






On Friday 10 March 2023 at 12:51:40 GMT+1, Dominik Stadler 
 wrote: 





Hi,

Some of them likely have had a valid use-case and would at least cause
performance issues if removed.

The issues from Tomcat or other WebServers usually come because they check
if memory is lingering at the point when the thread is "given back" to a
global pool.

XmlBeans also uses ThreadLocals and there were similar reports some time
ago. There we provide
https://github.com/apache/xmlbeans/blob/trunk/src/main/java/org/apache/xmlbeans/ThreadLocalUtil.java
which allows to clean out all ThreadLocals in the current thread and can be
used in a Web-Application to release stuff at the end if necessary.

I would propose to provide a similar util for POI, I even have an initial
version of it, but never managed to finish it. Unless you object I can tidy
it up and add it as solution for anyone having issues with threadlocals.

Dominik.

On Wed, Mar 8, 2023 at 10:09 PM PJ Fanning 
wrote:

> Hi everyone,
>
> We have a lot of open issues about ThreadLocals.
> https://bz.apache.org/bugzilla/show_bug.cgi?id=66521 was opened today.
>
> With Virtual Threads (aka Project Loom), ThreadLocals seem like a bad
> solution.
>
> I've looked at the ThreadLocals in POI a few times and have always
> struggled to see what they really achieve.
>
> Would anyone object if we just simply remove them all?
>
> Interacting with individual HSSFWorkbook, XSSFWorkbook and their
> equivalents using multiple threads seems to be something that we don't test
> much and we could simply say it's a bad idea. Sure, being able to produce
> multiple separate docs with separate threads is definitely something we
> want.
>
> Does anyone have any thoughts?
>
> Regards,
> PJ
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
>
>

-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[GitHub] [poi] dependabot[bot] opened a new pull request, #439: Bump org.mockito:mockito-core from 4.11.0 to 5.2.0

2023-03-10 Thread via GitHub


dependabot[bot] opened a new pull request, #439:
URL: https://github.com/apache/poi/pull/439

   Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 
4.11.0 to 5.2.0.
   
   Release notes
   Sourced from https://github.com/mockito/mockito/releases;>org.mockito:mockito-core's 
releases.
   
   v5.2.0
   Changelog generated 
by https://github.com/shipkit/shipkit-changelog;>Shipkit Changelog 
Gradle Plugin
   5.2.0
   
   2023-03-09 - https://github.com/mockito/mockito/compare/v5.1.1...v5.2.0;>25 
commit(s) by Andriy Redko, Iulian Dragos, Roberto Trunfio, Róbert Papp, 
dependabot[bot], jfrantzius, tobiasbaum
   Fixes 2933: IOUtils does not depend on platform encoding any more [(https://redirect.github.com/mockito/mockito/issues/2935;>#2935)](https://redirect.github.com/mockito/mockito/pull/2935;>mockito/mockito#2935)
   Execution with mockito-inline fails on platforms with EBCDIC as default 
encoding [(https://redirect.github.com/mockito/mockito/issues/2933;>#2933)](https://redirect.github.com/mockito/mockito/issues/2933;>mockito/mockito#2933)
   Bump io.github.gradle-nexus:publish-plugin from 1.2.0 to 1.3.0 [(https://redirect.github.com/mockito/mockito/issues/2932;>#2932)](https://redirect.github.com/mockito/mockito/pull/2932;>mockito/mockito#2932)
   Bump versions.bytebuddy from 1.14.0 to 1.14.1 [(https://redirect.github.com/mockito/mockito/issues/2931;>#2931)](https://redirect.github.com/mockito/mockito/pull/2931;>mockito/mockito#2931)
   Bump com.diffplug.spotless from 6.15.0 to 6.16.0 [(https://redirect.github.com/mockito/mockito/issues/2930;>#2930)](https://redirect.github.com/mockito/mockito/pull/2930;>mockito/mockito#2930)
   Bump com.google.googlejavaformat:google-java-format from 1.15.0 to 
1.16.0 [(https://redirect.github.com/mockito/mockito/issues/2928;>#2928)](https://redirect.github.com/mockito/mockito/pull/2928;>mockito/mockito#2928)
   Bump io.github.gradle-nexus:publish-plugin from 1.1.0 to 1.2.0 [(https://redirect.github.com/mockito/mockito/issues/2924;>#2924)](https://redirect.github.com/mockito/mockito/pull/2924;>mockito/mockito#2924)
   Feature 2921 generic types [(https://redirect.github.com/mockito/mockito/issues/2923;>#2923)](https://redirect.github.com/mockito/mockito/pull/2923;>mockito/mockito#2923)
   Bump com.github.ben-manes.versions from 0.45.0 to 0.46.0 [(https://redirect.github.com/mockito/mockito/issues/2922;>#2922)](https://redirect.github.com/mockito/mockito/pull/2922;>mockito/mockito#2922)
   Use generic type information in TypeBasedCandidateFilter to circumvent 
type erasure [(https://redirect.github.com/mockito/mockito/issues/2921;>#2921)](https://redirect.github.com/mockito/mockito/issues/2921;>mockito/mockito#2921)
   Make project relocatable by using relative paths in the OSGi test task 
[(https://redirect.github.com/mockito/mockito/issues/2920;>#2920)](https://redirect.github.com/mockito/mockito/pull/2920;>mockito/mockito#2920)
   Cache misses due to OSGi tests referencing absolute paths [(https://redirect.github.com/mockito/mockito/issues/2919;>#2919)](https://redirect.github.com/mockito/mockito/issues/2919;>mockito/mockito#2919)
   Bump versions.bytebuddy from 1.13.0 to 1.14.0 [(https://redirect.github.com/mockito/mockito/issues/2918;>#2918)](https://redirect.github.com/mockito/mockito/pull/2918;>mockito/mockito#2918)
   Bump gradle/wrapper-validation-action from 1.0.5 to 1.0.6 [(https://redirect.github.com/mockito/mockito/issues/2917;>#2917)](https://redirect.github.com/mockito/mockito/pull/2917;>mockito/mockito#2917)
   Bump com.diffplug.spotless from 6.14.1 to 6.15.0 [(https://redirect.github.com/mockito/mockito/issues/2913;>#2913)](https://redirect.github.com/mockito/mockito/pull/2913;>mockito/mockito#2913)
   Bump versions.bytebuddy from 1.12.23 to 1.13.0 [(https://redirect.github.com/mockito/mockito/issues/2912;>#2912)](https://redirect.github.com/mockito/mockito/pull/2912;>mockito/mockito#2912)
   Bump ru.vyarus.animalsniffer from 1.6.0 to 1.7.0 [(https://redirect.github.com/mockito/mockito/issues/2911;>#2911)](https://redirect.github.com/mockito/mockito/pull/2911;>mockito/mockito#2911)
   Bump org.codehaus.groovy:groovy from 3.0.14 to 3.0.15 [(https://redirect.github.com/mockito/mockito/issues/2910;>#2910)](https://redirect.github.com/mockito/mockito/pull/2910;>mockito/mockito#2910)
   Fixes https://redirect.github.com/mockito/mockito/issues/2905;>#2905 : 
ThreadLocal classes can be mocked. [(https://redirect.github.com/mockito/mockito/issues/2908;>#2908)](https://redirect.github.com/mockito/mockito/pull/2908;>mockito/mockito#2908)
   StackOverflow while mocking a ThreadLocal on Mockito 5.1.1 [(https://redirect.github.com/mockito/mockito/issues/2905;>#2905)](https://redirect.github.com/mockito/mockito/issues/2905;>mockito/mockito#2905)
   Fix most Gradle warnings in build [(https://redirect.github.com/mockito/mockito/issues/2904;>#2904)](https://redirect.github.com/mockito/mockito/pull/2904;>mockito/mockito#2904)
   Android CI 

Re: thread locals in POI code

2023-03-10 Thread Dominik Stadler
Hi,

Some of them likely have had a valid use-case and would at least cause
performance issues if removed.

The issues from Tomcat or other WebServers usually come because they check
if memory is lingering at the point when the thread is "given back" to a
global pool.

XmlBeans also uses ThreadLocals and there were similar reports some time
ago. There we provide
https://github.com/apache/xmlbeans/blob/trunk/src/main/java/org/apache/xmlbeans/ThreadLocalUtil.java
which allows to clean out all ThreadLocals in the current thread and can be
used in a Web-Application to release stuff at the end if necessary.

I would propose to provide a similar util for POI, I even have an initial
version of it, but never managed to finish it. Unless you object I can tidy
it up and add it as solution for anyone having issues with threadlocals.

Dominik.

On Wed, Mar 8, 2023 at 10:09 PM PJ Fanning 
wrote:

> Hi everyone,
>
> We have a lot of open issues about ThreadLocals.
> https://bz.apache.org/bugzilla/show_bug.cgi?id=66521 was opened today.
>
> With Virtual Threads (aka Project Loom), ThreadLocals seem like a bad
> solution.
>
> I've looked at the ThreadLocals in POI a few times and have always
> struggled to see what they really achieve.
>
> Would anyone object if we just simply remove them all?
>
> Interacting with individual HSSFWorkbook, XSSFWorkbook and their
> equivalents using multiple threads seems to be something that we don't test
> much and we could simply say it's a bad idea. Sure, being able to produce
> multiple separate docs with separate threads is definitely something we
> want.
>
> Does anyone have any thoughts?
>
> Regards,
> PJ
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
> For additional commands, e-mail: dev-h...@poi.apache.org
>
>