Skip to content

The TcpNetServerConnectionFactory.run() must not block on the loop forever #8852

Closed
@artembilan

Description

@artembilan

The current logic is like:

			while (true) {
				acceptConnectionAndExecute();
			}

This blocks a thread in the executor forever.
Fix it to while (isActive()) { to properly react to the stop() call.

Otherwise with an internal executor we wait on the:

					if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) { // NOSONAR magic number
						logger.debug("Forcing executor shutdown");
						executorService.shutdownNow();

Which does not happen if we exit from the loop normally.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions