Skip to content

Commit

Permalink
Merge pull request #2432 from influxdb/truncation_rix
Browse files Browse the repository at this point in the history
RLock broker during topic truncation
  • Loading branch information
otoolep committed Apr 26, 2015
2 parents 885f25c + 812a73c commit 8b12472
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions messaging/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ func (b *Broker) startTopicTruncation() {
// TruncateTopics forces topics to truncate such that they are equal to
// or less than the requested size, if possible.
func (b *Broker) TruncateTopics() {
b.mu.RLock()
defer b.mu.RUnlock()

for _, t := range b.topics {
if n, err := t.Truncate(b.MaxTopicSize); err != nil {
b.Logger.Printf("error truncating topic %s: %s", t.Path(), err.Error())
Expand Down

0 comments on commit 8b12472

Please sign in to comment.