Skip to content

Conversation

@SolidWallOfCode
Copy link
Owner

No description provided.

}
return false;
auto &tg = eventProcessor.thread_group[ET_CLUSTER];
return ET_CLUSTER && std::any_of(tg._thread, tg._thread + tg._count, [et](EThread *t) { return t == et; });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is it valid that a thread in the ET_CLUSTER thread_group not be of type ET_CLUSTER?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how the current code works. The type is a bit mask. But more realistically, it's cluster code, it should never be called. But I might want to put the ET_CLUSTER check first - if it's zero then the cluster group was never set up.

}

virtual int start(int n_cache_threads = 0, size_t stacksize = DEFAULT_STACKSIZE);
virtual int start(int n_cache_threads = 0, size_t stacksize = DEFAULT_STACK_SIZE) override;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the name of the constant is changed to add an underscore but the variable name is not?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh. I'll look at that.


/// Convenience overload.
/// This registers @a name as an event type using @c registerEventType and then calls the real @c spawn_event_threads
EventType spawn_event_threads(const char *name, int n_thread, size_t stacksize = DEFAULT_STACK_SIZE);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels icky to me. 🚲

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's handy in several places.

eventProcessor.spawn_event_threads(ET_GROUP, n_group_threads, GROUP_STACK_SIZE);


The function :code:`Group_Thread_Init` can be replaced with a continuation if that's more convenient. One advantage of a continuation is additional data (via :arg:`cookie`) can be provide during thread initialization.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is edata being replaced with cookie? Seems like a name collision to use cookie.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mixed about that. It's called a cookie in the Event structure, which is where the argument name comes from.

signal_hook(nullptr),
tt(att),
server_session_pool(nullptr)
EThread::EThread(ThreadType att, int anid) : id(anid), tt(att), server_session_pool(NULL)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing nullptr to NULL?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this was done initially before the Great Null Shift and I missed this during the merge.

/// Set the affinity for the current thread.
int set_affinity(int, Event *);

#if defined(HAVE_HWLOC_OBJ_PU)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be #if defined(TS_USE_HWLOC)?

Debug("iocore_thread", "EThread: %d %s: %d CPU Mask: %s\n", i, _name, obj->logical_index, cpu_mask);
#else
Debug("iocore_thread", "EThread: %d %s: %d", i, obj_name, obj->logical_index);
Debug("iocore_thread", "EThread: %d %s: %d\n", i, _name, obj->logical_index);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding newline char here?

PSUdaemon and others added 23 commits May 15, 2017 17:13
Standardize error messages by removing the terminating period.
	Coverity 1199997
	Coverity 1200000
	Coverity 1200003
	Coverity 1200012
This also undoes a previous change, that hopefully the new model rule
will take care of (instead of nesting the if/else).
The name of this type is misspelled in the documentation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This is for the GNU indent tool, which has been superseded by clang-format.
Let's use some C++11 features!
…ter.

TS_LUA_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME was mapped to the wrong
TS_CONFIG_... value. This patch corrects the mapping thus allowing
the negative caching lifetime to be changed via the Lua plugin.
scw00 and others added 20 commits May 23, 2017 15:38
The file is empty so I don't think we need it.
Replaced all calls to do_io(VIO::ENUM, ...) with matching do_io_*(...).
The eventProcessor.spawn_thread() is used to create a DEDICATED EThread.
The n_dthreads is total number of DEDICATED EThreads. When a new
DEDICATED EThread created, it makes the `all_dthreads[n_dthreads]' point
to the EThread object then do `n_dthreads++'

It is not likes the spawn_event_threads() that only called from main()
before any EThread runs. It is can be called from main() and/or any
EThread.

Therefore there is a race on accessing `all_dthreads[n_dthreads]' and
`n_dthreads++'.
SolidWallOfCode added a commit that referenced this pull request Apr 21, 2018
# This is the 1st commit message:

BufferWriter: Formatting tweaks, updated documentation.

# The commit message #2 will be skipped:

# BufferWriterFormat: Add support for sockaddr and IpEndpoint.

# The commit message #3 will be skipped:

# BufferWriter: Cleanup pass.
# Exchange align '^' and '=' to conform to documentation and Python spec.
SolidWallOfCode pushed a commit that referenced this pull request Jul 10, 2023
Fix the `make check` failure with the following output by changing to
.gold which meets our license exclusion regex rules:

 Printing headers for text files without a valid license header...

=====================================================
== File: ./tests/gold_tests/records/gold/renamed_records.out
=====================================================
```
┌■ 8 Renamed records:
└┬──» #1 : proxy.config.output.logfile -> proxy.config.output.logfile.name
 ├──» #2 : proxy.config.exec_thread.autoconfig -> proxy.config.exec_thread.autoconfig.enabled
 ├──» #3 : proxy.config.hostdb -> proxy.config.hostdb.enabled
 ├──» #4 : proxy.config.tunnel.prewarm -> proxy.config.tunnel.prewarm.enabled
 ├──» #5 : proxy.config.ssl.origin_session_cache -> proxy.config.ssl.origin_session_cache.enabled
 ├──» #6 : proxy.config.ssl.session_cache -> proxy.config.ssl.session_cache.value
 ├──» #7 : proxy.config.ssl.TLSv1_3 -> proxy.config.ssl.TLSv1_3.enabled
 └──» #8 : proxy.config.ssl.client.TLSv1_3 -> proxy.config.ssl.client.TLSv1_3.enabled
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.