Community
Chat Logs
Thursday, August 27, 2026
- llanhmockp
- llanhmock33333333333333333333333333333333
- llanhmocksorry about that folks
- Opticcats eh
- Opticalways causing trouble
- NeXeNyes! i did it
- NeXeNyou know, building a rom for nes isn't that hard. they're very simplistic. i'm working on building a rom editor/game engine for nes and i got my first little sprite to move around with the joystick
- NeXeNi love that feeling when it actually works, but i hate it because that means now you know you have all this work ahead. usually where my personal projects meet their end
- NeXeNi don't understand the opcodes well but at least i can implement the spec. going to take forever to figure out what everything does
- Opticthat's a great education project
- NeXeNi was bored. and i was also debugging a problem with my joystick, then decided hey i can just go ahead and do a little more
- odinsbaneI have an `Executors.newSingleThreadExecutorService` it spontaneously ends up not accepting new tasks.
- odinsbaneThere is a point in the code where I call a shutdown, but that occurs on a windows listener when the window is closed.
- odinsbaneIs there any other reason I would suddenly start getting "RejectedExecution" exceptions while using a single thread executor service.
- odinsbaneThe only thing I can think of is a spurious windowclosed event gets passed even though the window isn't closed.
- odinsbane... that doesn't make sense though because in that case a flag is set that would cause warnings to occur.
- NeXeNhrmm lets see...
- NeXeNwell, swing does have a little issue with race condition on window teardown
- NeXeNwindow listeners can trigger RejectedExecutionExceptions
- NeXeNmight have duplicate listeners as well, which is easy to do. and they can sometimes be doing things
- NeXeNbut afaik, the newSingleThreadExecutor() uses an unbounded link blocking queue, and it only throws rejected execution when the queue reaches maximum capacity, or usually the executor is shutting down, so yeah the window event is where i would look
- NeXeNalso if you tell me what you did before you suddenly started seeing anything, 75% chance that is it
- odinsbaneIt only happens when I run my program through fiji. If I run it stand alone, it works. I have tried to repeat exactly what I did, and I cannot repeat the problem.
- NeXeNyeah, https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/Executors.html#newSingleThreadExecutor() it is unbound queue
- nevetExecutors (Java SE 21 & JDK 21)
- NeXeNdoesn't fiji have it's own lifecycle, memory, and window management behaviour?
- odinsbaneYes, I am not sure of all the differences.
- NeXeNif you're depending on Executors.newSingleThreadExecutor()'s auto closing wrapper, maybe try to construct a concrete threadpool yourself, and just keep explicit reference lifecycle tied to the window's own lifecycle
- NeXeNthat way you are the one in control, and you're not depending on the who knows what is going on within that lifecycle, because from what you said that's my first instinct is lifecycle management
- odinsbaneI'm not using the autoclose, I just use it to create an exector. Then when the window gets closed, it shutsdown the executor.
- deebounless you constantly need new ones for some reason, just create one and tie it to the process' exit listener to shut down
- NeXeNyeah, explicitly manage it is the fool proof way
- deeboanyone using apache hc5 with connection pooling in spring boot and creating a single pool shared between all clients (web/restclient)? would be interested in seeing configs as i can't come up with a config that is not annoying to read and might get broken in upgrades
- deebothe autoconfiguration for these is soooo complicated, and there's no trivial path to a shared connection manager without losing some spring internal config bindings etc
- NeXeNwell if you wanna share hc5 connection pool across both the rest client and web client, you could probably ....hold on let me read the docs real quick
- NeXeNok, so if you make a bean to back both client builders....and of course you'd want a closeable http client...hrmm
- ParaI think I've done that somewhere.
- ParaNow is it public, hmm...
- NeXeNhttps://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/reactive/HttpComponentsClientHttpConnector.html ok found what i was looking for
- nevetHttpComponentsClientHttpConnector (Spring Framework 7.0.9 API)
- Para(FWIW I don't like Apache HC, after version 3 they went full design patterns for patterns' sake)
- NeXeNis that not the worst named class ever?
- NeXeNwait, RestClient is blocking, and webcleint is non-blocking async....ok so you'll want async request factory or ....i dunno maybe both builders share the same configuration/customizer
- NeXeNyeah you are right deebo, it is complicated
- NeXeNPara: design patterns are nice when you recognize them, not so nice if you gotta look them up in a catalogue